how can i made my object move forward once i press “w”?? also i would like to make my object turned left and right once i press “a” and “d”… Please help me guys…
here’s my code…
function Update ()
{
//forward movement
if(Input.GetKey(“w”))
animation.CrossFade(“run”);
animation[“run”].wrapMode= WrapMode.Loop;
sir it doesn’t work… i put already put a character controller in my character component…
when i test the code it the unity say’s that
“MissingComponentException: There is no ‘Rigidbody’ attached to the “jeenanimations” game object, but a script is trying to access it.
You probably need to add a Rigidbody to the game object “jeenanimations”. Or your script needs to check if the component is attached before using it.”