I need help with my javascript in UNITY

September 3, 2012 at 06:47:28
Specs: Windows 7
Hello im following a book called Unity 3.x Game Development Essentials. And im stuck with these warnings
Assets/Scripts New/Shooter.js(14,1): BCE0044: expecting (, found 'Input'.
and many others...
Here is my script i need fixed

var bullet : Rigidbody;
var power : float = 1500;
var moveSpeed : float = 5;

function Update () {
var h : float = Input.GetAxis("Horizontal") * Time.deltaTime *
moveSpeed;
var v : float = Input.GetAxis("Vertical") * Time.deltaTime *
moveSpeed;
transform.Translate (h,v,0);
if
Input.GetButtonUp("Fire1")){
var instance: Rigidbody = Instantiate(bullet, transform.position,
transform.rotation);
var fwd: Vector3 = transform.TransformDirection(Vector3.for…
instance.AddForce(fwd * power);
}


See More: I need help with my javascript in UNITY

Report •


#1
September 8, 2012 at 07:58:17
This has been on here a while, and I am no expert at this one, it looks like there is a parenthesis that is still open.
:: mike


Report •
Related Solutions


Ask Question