Quantcast
Viewing all articles
Browse latest Browse all 108

Unexpected Symbol `:' expecting :

Trying to create a simple cube object with my script based on [this script reference][1]. [1]: http://docs.unity3d.com/Documentation/ScriptReference/GameObject.CreatePrimitive.html Here's my code: using UnityEngine; using System.Collections; public class rando : MonoBehaviour { void Start () { var cube : GameObject = GameObject.CreatePrimitive(PrimitiveType.Cube); cube.transform.position = Vector3(0, 0, 0); } void Update () { } } the error is at the var cube line(10) and it doesn't like the colon even though the script reference includes it. What am i doing wrong?

Viewing all articles
Browse latest Browse all 108

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>