Hi I'm wondering how to know how values, vars, prefabs, etc. work and how to type pacific scripts to get things working without problems etc. like for an eg. (this is someone else's idea not mine but any way) if you want an object to act like a player that can walk etc. this is the code.
var speed = 3.0;
var rotateSpeed = 3.0;
function Update ()
{
var controller : CharacterController = GetComponent(CharacterController);
transform.Rotate(0, Input.GetAxis ("Horizontal") * rotateSpeed, 0);
var forward = transform.TransformDirection(Vector3.forward);
var curSpeed = speed * Input.GetAxis ("Vertical");
controller.SimpleMove(forward * curSpeed);
}
@script RequireComponent(CharacterController)
How am I suppose to know how all of that stuff works?