Yes, I’ve checked it and I cannot really see anything other than it is a bug. I changed vars so they were self.somevars instead and tried to make sure it was waterproof.
As transformation is not immediately changing after set_parent (as it is a message) I check the transf in the first update call.
function update(self, dt)
if not self.first then
self.first = true
print(go.get_id())
print(go.get_scale(self.gun_go),go.get_position(self.gun_go),go.get_rotation(self.gun_go))
print(go.get_world_scale(self.gun_go),go.get_world_position(self.gun_go),go.get_world_rotation(self.gun_go))
end
end
And it prints:
DEBUG:SCRIPT: hash: [/dodik/root]
DEBUG:SCRIPT: vmath.vector3(1.0000001192093, 1.0000001192093, 1) vmath.vector3(45.899993896484, 23.800003051758, 1) vmath.quat(0, 0, 0, 1)
DEBUG:SCRIPT: vmath.vector3(1, 1, 1) vmath.vector3(496, 257, 1) vmath.quat(0, 0, 0, 1)
DEBUG:SCRIPT: hash: [/collection0/root]
DEBUG:SCRIPT: vmath.vector3(nan, nan, nan) vmath.vector3(nan, nan, nan) vmath.quat(nan, nan, nan, nan)
DEBUG:SCRIPT: vmath.vector3(nan, nan, nan) vmath.vector3(nan, nan, nan) vmath.quat(nan, nan, nan, nan)
Weird as I do similar things in our project but not with Spine bones though. Works fine when using keep_world_transform = 0.
I would file it as bug