Solved I need help with JavaScript for Unity; Novice Qusetion

November 1, 2012 at 18:10:42
Specs: Windows 7
Okay, so there is some syntax error with my JS I'm using to control the main camera in unity: have a look:

function Update ()
{
	if(Input.GetButtonDown(KeyCode.ForwardW))
	{
		transform.position.z += .25;
		setTimeout(function(){transform.position.y += .1}, 0050;);
	}

This is made so the camera bounces, and I havent added the falling part yet because on line 6 (with the timeout) it claims that on 6,65 a semicolon is expected, but there already is one! Help please!

Note that I defined "ForwardW" in Unity :P


See More: I need help with JavaScript for Unity; Novice Qusetion

Report •

#1
November 3, 2012 at 07:13:03
Can anybody help me?

Report •

#2
November 12, 2012 at 13:49:29
✔ Best Answer
Take out the first semicolon after 0050

Report •
Related Solutions


Ask Question