Infinite obstacles on a plane
I'm trying to make a 3d infinite runner, and I have figured out how to place down tiles in front of me while deleting tiles behind me, but I'm having trouble figuring out how to randomly spawn my default obstacle in random positions in front of me.
Answer by tormentoarmagedoom · Feb 02, 2019 at 05:00 PM
Good day.
You only need to use Random.Range to select random positions and random elements.
If you have an array of Gameobjects (like rpefabs) you can select them by random
public GameObject[] PrefabList;
Instantiate (PrefabList[Random.Range(0,10)],position, rotation);
Ypu can change the position vector fora new vector generated at random.
Go investigate, use your brain, and try try try!
Good luck!
Your answer
Follow this Question
Related Questions
3D Side-Scrolling shooter looping background 0 Answers
How important is the order of Vertices in the mesh array that the triangles point to? 0 Answers
some textures are invisible 1 Answer
Side Scroller with 2D Character and 3D Enviornments. 0 Answers
Check if UI element is same / similar colour as the thing behind it 0 Answers