- Home /
movement script
var speed= 3.0;
var rotateSpeed = 3.0;
function Update(){
var controller: CharacterController = GetComponent(CharacterController);
//rotate y-axis
Transform.Rotate(0, Input.GetAxis("horizontal") * rotateSpeed, 0);
// move forward\backward
var forward = transform.TransformDirection(Vector3, forward);
var curSpeed = speed * Input.GetAxis("Vertical");
Controller.SimpleMove(forward * curspeed);
} @script RequireComponent(CharacterController)
can anyone tell me wat is wrong is my movement script?
What is this, a test?
You're supposed to tell us what's wrong- we tell you how to fix it!
Are you unsuccessfully trying to copy and paste this script?:
Answer by syclamoth · May 18, 2012 at 11:44 AM
For starters, the lines
Transform.Rotate(stuff);
and
Controller.SimpleMove(whatev);
are using the classes 'Transform' and 'Controller', rather than the actual objects that you should be manipulating. Try this instead:
controller.SimpleMove(paramaters); // See the lower-case c in controller
transform.Rotate(rotations); // The 'small-t' transform means the automatic
// transform shortcut that gets the transform to
// which this component is connected.
Answer by ruifernandes01 · May 18, 2012 at 02:01 PM
sorry for not having explained myself well, is that the monodevelop this script results in this series of errors. i cant debug this script without errors :s
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
c# script not doing anything. 2 Answers
visible lights 0 Answers
Script Not Accepting Values from Editor 1 Answer
Sprint Script Error?!!!! 4 Answers