Need Help Programming 2 actors As Repeated Pattern

sinbotsinbot Member Posts: 232

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.Member Posts: 12,822
    edited March 2018

    Red:

    After 1 second
    -Destroy
    -Spawn Black

    . . . . .

    Black:

    After 1 second
    -Destroy
    -Spawn Red

  • IceboxIcebox Member Posts: 1,485

    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 Member Posts: 232

    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.