private var Bullet : GameObject;
function Update(){
//Get input position in pixels (screen-coordinates);
Vector2 screenPos = Input.touches[0].position;
//Convert from screen coordinates (pixels) to world-coordinates;
Vector3 worldPos = camera.ScreenToWorldPoint(new Vector3(screenPos.x, screenPos.y, camera.nearClipPlane));
//Move the empty-object to the location of click/tap;
transform.position = worldPos;
//Instantiate a new object at that location
Instantiate(Bullet , worldPos , Quaternion.identity);
//Fire away!
Bullet.rigidbody.AddForce(transform.forward * 5000);
}
In the console it brings up :
Shoot.js(4,12): UCE0001: ‘;’ expected. Insert a semicolon at the end.
Shoot.js(6,12): UCE0001: ‘;’ expected. Insert a semicolon at the end.
Line 4 and 6 both have semicolons at the end , but error still shows . I’ve saved and everything . They both also have Vector2/3 in it ? Does that have something to do with this.