I have a 2D character that moves, jumps and climbs using my player scripts and Rigidbody2D. There is an Animator component which controls the sprite animation and nothing else.
I am adding a ledge grab and pull up feature but have run into a problem making my character pull themselves up the ledge.
What I wanted to do is create a simple transform position animation of the character object moving up and across so that it would now be on top of the ledge (then I’d play the appropriate sprite anim to match). So I add a new anim clip which moves the character up and sideways slightly, but when I do this the animator warns me that “Root position or rotation are controlled by curves”. This is true of this single animation, but it only get’s played at a certain time.
If I try playing the game with this warning, my character just falls through the world. If I enable ‘Apply Root Motion’ then the animation will function correctly but I can’t move my character as it’s now relying on animations to provide movement instead of the rigibody2D.
I’ve tried changing the Interpolate modes on the Rigibody and the Update Mode on the Animator but none of them give me what I’m looking for.
Hey mate,
I have some problem like you do, well kinda.
And first of all go review the “root motion” section, cause its very tricky.
I gues you didnt “generate Root Motion Curves” in the animation in hierarchy.
So your curves dont hold your rigidbody up and its falling…
The animation I made was in the Unity animation editor - just simple keyframes. The only option on this animation clip is to toggle ‘Remove Root Motion Curves’ / ‘Generate Root Motion Curves’ Neither seem to make any difference.
After having a fiddle, I’ve found I can add a keyframe to my walk animation (this stops the character falling through the ground), turn on ‘Apply Root Animation’ in the Animator then I can move my character in game.
But the climb ledge animation won’t play properly - it’ll add sidewards motion but not vertical motion (maybe it’s fighting against the physics). I can get it to play the correct animation by making the Rigidbody Kinematic but this doesn’t feel like the right solution.
All I want to do is move my character via a transform animation as I would by dragging the character in the viewport while the game is running.
If disabling the ‘Is Kinematic’ is the right solution, then I can go with that but want to make sure I’m doing it correctly.
Hi, I had similar problem.
My case was one of my sprite stuck and it is not moved by dragging.
And animator said just like you. Root position or rotation are controlled by curves
I checked the apply root motion on animator inspector.
It worked.
Hope this help you. : )
I have a same problem. When I apply root motion, physics starts working, but the charecter starts falling down too slow.
I mean a gravity for this object are very powerless. Without this flag gravity is strong, collider of my object does not work.
Hi !
I just had the same case. I did a ledge climb animation, where i need to move the character at the end of the animation.
I finally made my ledge animation working in a scene, and then my characters couldn’t move in the others scene.
The only difference was the “Root position or rotation are controlled by curves” in the animator.
It means that you probably have an animation with a property where you move the position of your character.
This is what i first tried to do, for my ledge climb animation i was moving the transform position with the property in my animation.
To fix the bug i removed the property in the animation, and i apply the new position in my character controller.
It worked for me, i hope it will for you too.
What helped me was setting the “apply root motion” option in my script. I set my animator’s apply root motion property in my start method. Seems to work okay.
I tried to apply animation to my hand controller, and once I did my controller model was not aligning with my physical controller. Apply root motion option under the animator component has solved the issue.
Thanks