Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

Cilck to move script malfunction need help

$
0
0
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. }// 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);

Viewing all articles
Browse latest Browse all 7934

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>