Help with random spawning

RedRoboRedRobo Member, PRO Posts: 682

I thought this would be easy but I'm really struggling!

I want an actor to appear repeatedly after a random amount of time which varies between 1 and 7 seconds. The actor only appears for about half a second and is then destroyed. Everything I try just keeps making the actor appear after the same amount of seconds and I can't get the random amount of time to update properly.

Thanks in advance.

Comments

  • SocksSocks London, UK.Member Posts: 12,822
    edited October 2014

    In the timer when you enter a random time, it will generate a random value when the game starts and use that same value throughout, so if Every random (10,100) chooses 78, it will stick with Every 78 seconds throughout the game.

    You can do it like this.

    Make a game.attribute, let's call it X.

    In the spawner:

    Change X to random (10,100)

    Timer: After X seconds

    - - Spawn the actor you want to spawn

    - - Spawn the Spawner

    - - Destroy

  • RedRoboRedRobo Member, PRO Posts: 682

    @Socks‌
    That makes total sense and explains why my random timer was not changing, thank you very much :)
    It seems obvious now but sometimes I just hit a brick wall!

    My project is up and running again :smiley:

Sign In or Register to comment.