- Home /
Whats the correct way to move a character through the scene?
I ask this because my character is not colliding with the scene objects. I have a terrain and some cubes with boxcollider. But the character (with rigidbody and cylindercollider) walks through them. I move the character with transform.Translate(...).
#pragma strict
var movSpeed:float = 5f;
var rotSpeed:float = 150f;
function FixedUpdate ()
{
transform.Translate(Vector3.forward * Input.GetAxis("Vertical") * movSpeed * Time.deltaTime);
transform.eulerAngles.y += Input.GetAxis("Horizontal") * rotSpeed * Time.deltaTime;
}
Ok, the problem was that I forgot to uncheck 'is kinematic' flag in RigidBody component. That solved the colision issue, but now sometimes the character starts to slide over the terrain (without any input). Why?
I don't know how to properly set up my character and the scene objects with the physic system.
Answer by Jeff-Kesselman · May 11, 2014 at 04:15 PM
You really should post a new question when your question changes.
The answer is likely that you are being pushed by collision forces. If you don't want that to happen you need to lock axes using constraints:
Your answer
![](https://koobas.hobune.stream/wayback/20220613144801im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Destroy On Collision 4 Answers
Combine common surfaces 1 Answer
Weirdest Collision EVER 1 Answer
Can't detect isgrounded? Help 1 Answer