Spawn new actor!

Hey guys! In my current game i want the same actor to spawn when the other actor disappears. So when actor no.1 flies away and is outside the screen i want actor no.2 to spawn, but with the same rules and behaviors. Anyone who can help me with this? Thanks!

Comments

  • SocksSocks London, UK.Member Posts: 12,822

    It should be as simple as you've described it . .

    In actor 1, have a rule that says:

    When position is outside the screen
    --Destroy this actor
    --Spawn another copy of this actor somewhere on the screen

  • Yes, but i want it to spawn on the exact same spot as the one before was on from the beginning. :) Thanks

  • seyjoseyjo Member Posts: 3

    hmm i would go this way:
    Create an empty Actor and set Alpha to 0
    -new Global Attribute: ActorDied - true
    -Rule:
    if Att: Actor died = true
    then
    spawn Actor "Your Actor"

    -change attribute "ActorDied" = false
    else
    /

    The Actor "Your Actor" with
    two possibilities:

    1:
    Rule:
    if actor X and Y is out of Screen
    then
    -Destroy actor
    -change Attribute "ActorDied" = true

    2:
    if "Your Actor" collide with Wall (a wall outside the Screen)
    then
    same as 1

  • SocksSocks London, UK.Member Posts: 12,822

    @linusodelin@gmail.com said:
    Yes, but i want it to spawn on the exact same spot as the one before was on from the beginning. :) Thanks

    You would simply enter the relevant X and Y positions into the two X and Y position fields.

Sign In or Register to comment.