Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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). alt text alt text alt text

Can someone help me out please?

Greetz, Tristan

Product Version: UE 4.18
screenshot-1.png (106.3 kB)
untitled.png (720.8 kB)
screenshot-2.png (11.3 kB)
more ▼

asked May 23 '18 at 12:39 PM in Blueprint Scripting

avatar image

13 1 7

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

You need to pass in a DateTime to that node.

You want the node called "Now".

alt text

capture.png (15.4 kB)
more ▼

answered May 23 '18 at 01:01 PM

avatar image

1.3k 1 14 16

avatar image TristanPiejn May 23 '18 at 02:14 PM

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

(comments are locked)
10|2000 characters needed characters left

random is cool

more ▼

answered May 23 '18 at 12:54 PM

avatar image


avatar image TristanPiejn May 23 '18 at 01:01 PM

You are special

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question