Not allowing the character to fall after collision
Hi everyone,
I have a character moving in a maze. It moves using transform.Translate and rotates on the y-axis using transform.Rotate. But, when my character collides with a wall, it falls on the x-axis or the z-axis. It has a rigidbody and its constraints are on the x and z axis for rotation. After falling down, it shows some weird behaviour after pressing the arrow keys. Is there anyway to avoid my character to fall or just keep the rotation of the x and z axes 0.
EDIT:
Let me be a bit more precise. I made number 10 using cubes. The cubes are the child objects of an empty gameObject. I attached the Rigidbody to the empty game Object but nothing happened. I also added a box collider but still nothing happened.
Any help would be appreciated.
Thank you.
Answer by Imankit · Nov 08, 2016 at 09:28 AM
Make your rigidbody kinematic or freeze rotation. Anything would be fine.
When I checked is kinematic, then it was going through walls. There was no collision.
Your answer
Follow this Question
Related Questions
Freeze rotation of just the box collider component 0 Answers
Rotate camera on collision of character 1 Answer
Character Rotation 0 Answers
Rotated object raycasting in wrong directions!!? 3 Answers
CapsuleCollider check if grounded 1 Answer