How do I randomly spawn an actor in between a certain area?

jacob717jacob717 Member Posts: 9
edited April 2015 in Working with GS (Mac)

How would I spawn an actor into a random area such as in between the white space? (just make up dimensions for the area, just need an example) Thanks! :)

http://i1243.photobucket.com/albums/gg556/Jake717/Untitled.png

Comments

  • mhedgesmhedges Raised on VCS Member Posts: 634

    @jacob717,

    Let's say your white area starts at x=400, ands at x=460 (I don't really know, but you get the picture).

    At its simplest, your Spawn behaviour should spawn the actor at x=value between 400 and 460, y = value between 0 and highest value of y (depending on game size).

    From there, then you would build your conditions on how to spawn - timer, score, whathaveya.

    Good luck!

  • jacob717jacob717 Member Posts: 9

    @mhedges

    I can't get it to work :(

  • mhedgesmhedges Raised on VCS Member Posts: 634

    What happened? Spawn at the wrong place or no spawn? If wrong place, then recheck your x and y ranges. If no spawn, do you have an actor invoking the spawn actor behavior?

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

    Here's a demo.

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

  • RabidParrotRabidParrot Formally RabidParrot. Member Posts: 956

    Spawn Actor

    ↑ random(50,300) → random (50,300) relative to scene

Sign In or Register to comment.