- Home /
Make an object move without a Character Controller?
I want to know if it's possible to make an object move without a Character controller attached to it or by using the addforce to a rigidbody.I want to make it move only through scripting (wasd, transform.Translate, transform.Rotate) without using the character controller.I have tried it before but failled and dont know what to do. Do I have to add a rigidbody or a collider to it besides the script.I am new at this and I am asking for help in this matter.Thank you.
Answer by Bunny83 · Aug 13, 2012 at 05:38 PM
Is there a good reason why you don't want to use the CC?
anyway, you can always use a kinematic rigidbody (set isKinematic to true) and move it with Rigidbody.MovePosition and Rigidbody.MoveRotation.
Btw, you can always move any object with it's transform component, but you won't have collision detection of course.
A Rigidbody needs an seperate collider to work. A CharacterController is it's own collider, but don't use it with a Rigidbody.
Answer by Nk.Andrei · Aug 15, 2012 at 11:17 AM
Btw, you can always move any object with it's transform component, but you won't have collision detection of course.
Well, I have tried to make a simple move command with nothing more than a sinmple script and it worked:
-function Update() { if(Input.GetKey("a")) transform.Translate(0.5*Time.deltaTime, 0, 0); }
}
Thanks.