- Home /
Problem with Unity Terrain and GameObject
Hello, thank you for taking the time. I would like to know how to solve the problem that a GameObject with rigidbody component sinks into a terrain. I have attached a video where you can see my problem. To move the GameObject I used rigidbody.movePosition()
Of course, I added the colliders to both objects. Many greetings!
Answer by Marioooo · Feb 23 at 06:47 PM
I think the move position method, moves the rigidbody ignoring colliders, you should move the character with a force... https://docs.unity3d.com/ScriptReference/Rigidbody.AddForce.html and using impulse as the force mode https://docs.unity3d.com/ScriptReference/ForceMode.Impulse.html also don't forget to lock Y position to avoid player falling to the ground
Thank you very much for your reply! The AddFource method helps, but locking the y Axis does not, because then you stay only on one plane, which is not suitable for a terrain.
Your answer
Follow this Question
Related Questions
Navmeshagents, Character Controllers and Colliders 1 Answer
3D world 2D gameplay, keep player in the camera? 1 Answer
Line is not Affected by Physics 0 Answers
colliders arenot colliding 1 Answer
Colliders Not Working 1 Answer