- Home /
Random Vector2 generation(within set of ranges) and gameobject spawning in the vector 2,Random Vector2 generation within a range a nd gameobject spawning
Hi all, i am just starting unity and creating a simple endless platformer game. In order to make it endless, i made a starting ground on which the player always spawns and it is permanent, then I added a empty gameobject , gave it a box collider(with "is trigger" box checked). Then i coded a simple script so that when the player hits the collider, it gives a message in console saying "we r in range". After this, i want to to make a script so that unity will choose a random prefab from a set of prefabs(which i will make), and i want unity to check which prefab it is and depending on that, i want unity to spawn the prefab within a fixed number of vector2 values(which i will give and each prefab will have different value range). This is what my plan, if any one knows it, please answer and if someone knows a simpler method, I am ready to go on with that
Your answer
Follow this Question
Related Questions
Deriving and angle from two points 1 Answer
Need help with Vector3s and Vector2s 2 Answers
Overload Vector3's operator + 2 Answers
Joystick to turn object 1 Answer
initialising a list with values, and adding a range to a list 2 Answers