- Home /
Mecanim: character has stuck near a wall
Hello. I have 4 animation clips.
IDLE
Run
JumpUp
JumpForward
When character jumps in wall direction and faces with wall in air - he stuck in air. I using animation moves (Apply Root Motion checked). Watch the video plz. https://www.youtube.com/watch?v=9LqhsRtuUyA&feature=youtu.be How i can fix it? Thanks!
Answer by LSPressWorks · Aug 26, 2014 at 05:47 PM
I couldn't tell if he fell off the wall when he moved away.Need a touch more data please.
In his jump animation, are you using the animation to lift him into the air, or are you using a scripted jump state to apply force upward?
Does it still occur with a larger or smaller collider on the character? What is the collider on the cube? Does it occur with collision detection set to dynamic etc?
Lastly, is gravity turned on for the level and the rigidybody in question?
LSPressWorks. Yes, i use animation to lift him. Yes, it still occur with larger collider. Cube has Box Collider. Yes, it occure with collisition det. continuous and continuous dynamic. Yes, gravity is on.
Groovy. So as a general rule of thumb, the animation should be "heightless" in my experience, for this very reason. Ins$$anonymous$$d make the animation NOT lift him, and then in your code, when you trigger the jump apply if with something like this
animation.jump
//upjump
Character.rigidbody.AddRelativeForce(0,120,0,Force$$anonymous$$ode.Impulse);
//upjump with foward
Character.rigidbody.AddRelativeForce(this.transform.foward * 90,120,0,Force$$anonymous$$ode.Impulse);
Forcemode is optional, but I prefer impulse for alot of junk.
P.S. I have found that getting the jump and fall to look just right and smooth is usually a matter of the drag property of the torso....
But in official $$anonymous$$ekanim tuts noone use forces...
Answer by ChazAshley1 · Aug 26, 2014 at 09:14 PM
Ano... I just use CharacterController instead Rigidbody+CapsuleCollider, all works fine :33
Your answer
Follow this Question
Related Questions
Rigidbody gets stuck on wall? 1 Answer
Stop Mecanim from affecting the camera? 0 Answers
4.5 Mecanim Additional Layers doesn't work? 1 Answer
Navmesh stuck on obstacle 0 Answers
2D Platformer Moving Platform Question 3 Answers