Answer the question
In order to leave comments, you need to log in
Why is it not displayed when spawning an object in Unity, but it does appear?
There are several given coordinates and I need the object to spawn randomly on one of them.
I implemented it like this (screenshots).
Everything works as if when I press F, objects appear on the left, but do not appear in the game itself, only if I switch to the scene menu, they appear there as they should, and when I press F to spawn the object, an error occurs:
IndexOutOfRangeException: Index was outside the bounds of the array.
RandomSpawn.SpawnRandom () (at Assets/Scripts/RandomSpawn.cs:26)
RandomSpawn.Update () (at Assets/Scripts/RandomSpawn.cs:19)
Answer the question
In order to leave comments, you need to log in
Everything works for me
And put the code, not screenshots. If I want to debug the code, I'm not going to write from screenshots
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question