Question by
PsuedoKirito · Apr 28, 2019 at 07:26 PM ·
c#listscriptableobjectrandom.range
Loading Assets from a list
genplanet.AddComponent<Planet>();
var planet = genplanet.GetComponent<Planet>();
planet.shapeSettings = (shapes[Random.Range(0, shapes.Count)]);
List Declaration
public List<ShapeSettings> shapes = new List<ShapeSettings>();
I just want to load in a random sciptable object but it's not working how I thought.
Any help would be great
Comment
What's not working? Any error messages? What is happening?
Nothing is happening, no errors it's just not being assigned anything on runtime as it would if I were using planet.shapeSettings = Resources.Load<ShapeSettings>("Shapes/Destroyed");
Your answer
Follow this Question
Related Questions
What range of values need to be inserted if we need to pull a random item from the list? 0 Answers
Assign role randomly from array for my online game 2 Answers
How do I get random answers? 2 Answers
Array (List) with multiple variable types? 2 Answers
Detect changes in the value of other objects referenced? 1 Answer