- Home /
Dynamic rigidbody changes his positions when I move its sprite (2D game)
I am working in 2D game where the player can crouch. I change the Sprite position and the collider when the player crouches in order to make the Sprite touch the floor.
When I was working with kinematics rigidbodies the player could crouch perfectly. However, I needed horizontal collisions so I changed to Dynamic rigidbodies. After that, when the player crouches, the position of the player (its transform) changes, increasing the y. This is caused when the transform of the Sprite changes. I do a change in the localPosition of the Sprite becase it is the child of the player object.
Unfortunately, I need to change the Sprite local position to draw it properly. Any suggestion for correcting this problem?
Your answer
Follow this Question
Related Questions
how to make 2d sprite with polygon collider bounce? 1 Answer
Can Unity 4.6 UI System be used for physics based gameplay? 1 Answer
Rigidbody2D.Velocity = Vector2 not changing X Position 1 Answer
Making an object move back and forth in a 2D platformer. 0 Answers
How do i stop rigidbody2D bounce 1 Answer