- Home /
Question by
xX7399Xx · Apr 03, 2012 at 11:24 PM ·
varunexpectedtoken
Unxepected token: Var (Please Help)
I have been messing around with making a FPS i have got allot done but when I get to the script it says Unexpected token: var. I use notpad to edit it because it is the only program that works for me. my code so far is, #
function Start ()
var projectile : Rigidbody;
var speed = 20;
{function Update () {
if( Input.GetButtonDown( "Fire1" ) )
Thanks for any help
Comment
Answer by CC Inc · Apr 04, 2012 at 12:23 AM
If that is your entire script, it is formatted incorrectly:
var projectile : Rigidbody;
var speed = 20;
function Start ()
{
}
function Update () {
if( Input.GetButtonDown( "Fire1" ) )
{
// if action here
}
}
Could you use notepad++ or monodevelop?
Your answer
Follow this Question
Related Questions
Help me with this Unexpected token error 1 Answer
Unexpected Token:.. while following a tutorial. 1 Answer
Unexpected Token: if 2 Answers
Unexpected Token Error 1 Answer
Unexpected Token 3 Answers