Quantcast
Channel: Questions in topic: "javascipt"
Viewing all articles
Browse latest Browse all 1875

I cant figure out why my array is causing the error 'System.Type' does not support slicing.

$
0
0
// JavaScript //my array of spawn point values var A1 = Vector3(20,0.05,0); var A2 = Vector3(20,0.05,-5); var A3 = Vector3(20,0.05,-10); var B1 = Vector3(25,0.05,0); var B2 = Vector3(25,0.05,-5); var B3 = Vector3(25,0.05,-10); // My array list var SpawnPoints = Array["A1","A2","A3","B1","B2","B3"]; // My attampt to select 1 spawn point from the array to act as the enemy position var enemyPosition = SpawnPoints[Mathf.floor(Mathf.random() * SpawnPoints.length)]; function Start () { } function Update () { // my enemy at the moment is simply a cube, a new one with a rigid body should be instantiated at the enemy position var cube = GameObject.CreatePrimitive(PrimitiveType.Cube); cube.AddComponent.(); cube.transform.position = Vector3(enemyPosition); }

Viewing all articles
Browse latest Browse all 1875

Trending Articles



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