- Home /
Expression denotes a `type', where a `variable', `value' or `method group' was expected
what am i doing wrong?
using UnityEngine; using System.Collections;
public class GoalKeeper : MonoBehaviour { float range; // Use this for initialization void Start () { range = range Random.Range(-12.5f,-10.0f); } // Update is called once per frame void Update () { if(Input.GetButtonUp("Fire1")) { transform.position = transform.position + (Vector3(1,0,0)(range*Time.deltaTime)); } } }
You should format your code.
But I think you are missing a "new" keyword before Vector3: new Vector3(1,0,0)
Answer by OnlineCop · Nov 23, 2012 at 06:39 AM
DannyB is correct.
In Javascript, you use simply `Vector3()` while in C#, you need to use the `new` operator: `new Vector3()`
Answer by united4life · Nov 23, 2012 at 07:39 AM
Thanks for the information. new Vector was the only error.
Your answer

Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Another way to reference scripts? 2 Answers
Scripting error #2! 2 Answers
Problem with gun/shooting scripting 2 Answers
How do I correct the following error on the Lerpz Tutortial GUI 1 Answer