Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

I have an error on line 16 “The name “instantiateAsteroid” does not exist in the current context” how can I fix the error and what is the cause? thx for the help in advance.

$
0
0
1 using System.Collections; 2 using System.Collections.Generic; 3 using UnityEngine; 4 public class Asteroid : MonoBehaviour { 5 [SerializeField]int gridSpacing = 10; 6 [SerializeField]Asteroid asteroid; 7 8 void Start() 9 { 10 PlaceAsteroids (); 11 } 12 void PlaceAsteroids() 13 { 14 for (int x = 0; x < gridSpacing; x++) 15 { 16 instantiateAsteroid(x, 0, 0); 17 } 18 } 19 20 void InstantiateAsteroide(int x, int y, int z) 21 { 22 Instantiate(asteroid, new Vector3(transform.position.x + x, 23 transform.position.y + y, transform.position.z + z), 24 Quaternion.identity, transform); 25 } 26 }

Viewing all articles
Browse latest Browse all 2891

Trending Articles



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