Announcement

Collapse
No announcement yet.

Random Variables affect every Blueprint. How to make them random per BP instance?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Random Variables affect every Blueprint. How to make them random per BP instance?

    Hi all,

    So, I've built a blueprint for some spotlights in my game and have successfully assigned the flicker functionality, however, if I assign it to more than one light they all flicker at the exact same time. I've been researching a bunch of different recommendations on how to generate random numbers, however, even when this is successful (shown through a "print string" command) the information is fired off to every light in the game using the same information. As such, when they flicker, they all flicker the same.

    While I could assign an integer variable to each blueprint and build in a branch that would take each integer down a different timeline, this would make assigning the lighting a tedious task as it would have to be manually assigned for each and every light.

    Is there a way to make each instance of the blueprint behave differently/separately from others, so that if I had three of the same blueprint in the area, each one would flicker at a different rate? I originally had a random integer generate a number between 1 and 5, and had created five different timelines, but when it selects the random number, it sends the same timeline to every blueprint.

    I appreciate any ideas you may have!

    Thanks again!

    Rick
    Last edited by Firebrand Studio; 12-31-2018, 10:09 PM.

    #2
    Dang, I hate bumping these things, but I'm really hoping someone may have some input on this. Thanks in advance!

    Comment


      #3
      Hey,

      If you wanted to offset the flickers, you could put a delay between your event begin play and your timeline, with the delay time fed by a get random float in range. Don't use get random float in range from stream, as that will return the same value for all blueprints. Let me know if that starts you off on the right track.

      Comment


        #4
        Originally posted by VaSSiLi View Post
        If you wanted to offset the flickers, you could put a delay between your event begin play and your timeline, with the delay time fed by a get random float in range. Don't use get random float in range from stream, as that will return the same value for all blueprints. Let me know if that starts you off on the right track.
        PERFECT. Thank you, sir. That works like a charm!

        Comment

        Working...
        X