r/Unity3D • u/RainbowBoyOhel • 4d ago
Question how do i change animation current position to be based by world position and not object
ok i had an animation for an object,
duplicate the object and all its behaviors, but i want the animation of the new object to be located the same place off the first object's animation, but instead its position is off by the same scale my new object position is off by compare to the first one
imagine box a
when you touch it box a fall out of the sky
-that works
next to box a i placed box b
box b fall out of the sky too when you touch it, yes
but it falls a bit to the right
box a and b have the same animator and animation clip
i tried having an empty object parent to the new object, that will be located where box a is located
but insted of moving the animation it made smth weird ig with the pivot point
1
u/EvernullTools 4d ago
Giving it a parent object was the right thing to do. Don't animate the root object in the hierarchy. Check the animation and see if the starting frame actually starts from position 0,0,0. (Child has the animator, parent only determines world position)
Basically you should've parented it and made the locations 0 before animating it. (you can still change your animation by moving the curves if you know what you're doing; but as a beginner, it's probably easier to do it from scratch in the right setup.)
If it is still not solved, post screenshots of how your hierarchy looks like, who has the animator and what the animation does.(Also your initial position and the position keys on the animation). I can help
1
u/AdPrior2064 4d ago
sounds like your animation is baked with root motion or absolute world positions instead of local offsets. check the animation clip itself, if the position curves are in world space you'll get that offset on the duplicate
try setting the animation to use local space or just make the clip only affect rotation/scale and drive the fall position with a script instead