So this is my code. I made it successfully in gamemaker, now I’m trying to take it up a level. Problem is, it keeps resulting in a blob that looks like a compact rectangle of stars.
When viewing the guide points (the base of the spiral arms), they are in perfect spirals. So I’m confused.
Here I changed it a bit… So basically, I made it so that the guide points are stars, and the stars don’t render. So you can kinda see how this works: first the guide points make spirals, then the stars are randomly placed around the guide points. For some reason, the guide points are placed perfectly, but the stars are not.
It’s probably just an issue with the distances. During your placement, you’re setting star = guide + random up to 75 units away. Are you sure that’s not spawning a star on the other side of the galaxy?
I’d try changing the Random.Range() during spawn to something like 0 to 5, and see if you get closer to the shape you’re after.
So I’m making this script more complicated. I’m trying to include colors, heat, and red HII clouds from newly formed stars.
I have a bunch of classes for each object type in the galaxy (Star, HIICloud, GuidePoint), each of which as attributes (color,brightness,heat,distanceFromCore, etc). I’m a bit confused how I make this work in the game. How exactly does one turn a class in code into an object, so for instance, if I change the color property of a single object in the class, it changes that objects color in the game.
Basically, I understand how object oriented programming works, I just don’t get how to make it so that the different “objects” in the code correlate to the “objects” in the game.
This … your guide points are only spaced 10 units apart.
And as a rule of thumb, if something isn’t working at all, making it more complicated is probably not the best course of action. Your comments lead me to think you haven’t even watched the basic Unity tutorials. Commit an hour or two and watch the videos and you should be better equipped to understand the API reference and manual.