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

Error CS1061

$
0
0
hello, the console is giving this error: " error CS1061: Type `UnityEngine.GameObject' does not contain a definition for `Addomponent' and no extension method `Addomponent' of type `UnityEngine.GameObject' could be found (are you missing a using directive or an assembly reference?)" The Error is in the line 20 Here is the script. public Sprite floorSprite; World world; // Use this for initialization void Start () { world = new World (); world.RandomizeTiles (); //create a GameObject for each of our iles, so they show visually. for (int x = 0; x < world.Width; x++) { for (int y = 0; y < world.Height; y++) { GameObject tile_go = new GameObject (); tile_go.name = "Tile_" + x + "_" + y; SpriteRenderer tile_sr = tile_go.Addomponent (); Tile tile_data = world.GetTileAt(x, y); if (tile_data.Type == Tile.TileType.Floor) { tile_sr.sprite= floorSprite; } } } } Thanks for your help in advance,

Viewing all articles
Browse latest Browse all 2891

Trending Articles



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