spawning actors

Hi.

I need spawn 6 actors in random point in the scene, but i don't need it spawn like this

but for example like this

or maybe like this

Comments

  • ArmellineArmelline Member, PRO Posts: 5,369

    If you want to spawn without overlapping, you'll need to track the location of each spawned actor (probably in a table) and not spawn further actors that will overlap with that area. It's a lot more difficult than you might think. An easier route some people take is to spawn the actors invisible, and if they overlap with another, destroy them and spawn another one, and if they don't overlap with another, show them. With actors as big as in your example that probably wouldn't work very well, though.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    You might consider looping through a table of preset values (x and y) that ensure that you won't have overlaps. It's not truly random but if you use enough variance it can appear to be so.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.