GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Need Help Programming 2 actors As Repeated Pattern

sinbotsinbot Posts: 57Member, PRO

i have 2 actors that are identical except for having different color and behaviors. i need one actor (red/dangerous) to appear for about 1 second then be replaced with the other actor (black/helpful) for the same duration. i need these 2 actors to repeat this pattern but without overlapping each other (only 1 appearing at a time).

i tried a couple ideas (one involved a game attribute boolean, timers and loop) but nothing worked properly. would really appreciate some insight.

Comments

  • SocksSocks London, UK.Posts: 12,821Member
    edited March 13

    Red:

    After 1 second
    -Destroy
    -Spawn Black

    . . . . .

    Black:

    After 1 second
    -Destroy
    -Spawn Red

  • IceboxIcebox Posts: 1,472Member

    I once ran into a situation were the actor destroys itself before running the spawn behaviour , it happens once every 100 times , but it might break your game at a critical point. It would be safer to do a nested timer with a really short delay before destroying.

    ex:
    After 1 second
    after 0.01 seconds
    Destroy

    -Spawn Red

  • sinbotsinbot Posts: 57Member, PRO

    awesome, much more simple then what i had programmed before lol ty for the tip as well icebox. dropped a micro timer in there

Sign In or Register to comment.