Random integer in range not working!?

Hi everyone,

So i have this weeeiiiird issue when packaging my game.

I have multiple camera actors in my menu containing a ‘MenuCam’ as tag. I get all actors by that tag and
take a random out of that list and set it as the main camera (so overtime i start the game the view is never going to be the same). It works fine in the editor but when packaged it doesn’t work properly. So I tried using streams, i get the current time seconds and create a stream of it and replaced the ‘random integer in range’ node to a ‘random integer in range from stream’ node. Works in the editor but when packaged it still isn’t fixed???

Started debugging, created a widget with a text containing the current time seconds i get for creating the stream by simply binding the text value to a string variable and setting the variable after creating the widget and my conclusion is that the time seconds is being baked in when i package somehow. So if i were to package on the 53th second of a minute the time second value will alllllllways be 53 when i start my packaged game (that’s my closest guess but the point will still always be that the value is baked in and always will be the same when i start the game).

Can someone help me out please?

Greetz, Tristan

You need to pass in a DateTime to that node.

You want the node called “Now”.

241925-capture.png

random is cool

Alright it worked everytime i restart the game i get a new seed but there was also a weird problem on set the view target because of the player controller not yet initialized before reading that code or something so i had to put a small delay on the set camera target in begin play