- Home /
Cilck to move script malfunction need help!!!
Assets/NewBehaviourScript.js(1,1): BCE0044: expecting EOF, found '}'. is the error I get when ever I attach the script to a sprite i attach and go to press play and it pops up with this error if someone knows how to fix this please help i am trying to make a cool game and a rookie and this is my script maybe you more professional script writers can help. I got some more errors after trying to delete the }
list of errors:
Assets/NewBehaviourScript.js(24,1): BCE0044: expecting }, found ''.
Assets/NewBehaviourScript.js(23,99): BCE0043: Unexpected token: smooth.
Assets/NewBehaviourScript.js(23,98): UCE0001: ';' expected. Insert a semicolon at the end.
Assets/NewBehaviourScript.js(23,95): BCE0044: expecting ), found '4.0'.
Script:
// Click To Move script // Moves the object towards the mouse position on left mouse click
var smooth:int; // Determines how quickly object moves towards position
private var targetPosition:Vector3;
function Update () { if(Input.GetKeyDown(KeyCode.Mouse0)) { var playerPlane = new Plane(Vector3.up, transform.position); var ray = Camera.main.ScreenPointToRay (Input.mousePosition); var hitdist = 0.0;
if (playerPlane.Raycast (ray, hitdist)) {
var targetPoint = ray.GetPoint(hitdist);
targetPosition = ray.GetPoint(hitdist);
var targetRotation = Quaternion.LookRotation(targetPoint - transform.position);
transform.rotation = targetRotation;
}
}
transform.position = Vector3.Lerp (transform.position, targetPosition, Time.deltaTime 4.0 smooth);
Answer by pacific00 · Jun 06, 2014 at 05:40 AM
"}// Click To Move script // Moves the object towards the mouse position on left mouse click"
remove "}" at the beginning..
thanks for trying to help I don't have the error massage anymore but now it telling me i can add the script unless all the problems are fixed and its not popping up with problems do you know the solution to this?
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
GetComponent().enabled = true; 1 Answer
Script is not working at all 2 Answers
How do I get rid of these scripting Errors? 2 Answers
Inup.GetButtonDown not working? 1 Answer