Hello everyone, I have a blueprint ‘Mystery Box’, this blueprint has the variable ‘Show Mystery Box’, which toggles whether or not the actor is visible. I have several of these actors placed around the level, only 1 of them can be visible at a time. I am working on an event to try and randomize which box is currently visible using this event:
When I press x (X is set to not consume input, so this runs on every actor), the current active mystery box actor (the box that has ‘Show Mystery Box’ set to true), will pick a random index of a new mystery box actor to activate. This all works fine, but it will often pick its own index, despite me having a branch that checks for that. I am comparing the index of ‘This’ to the new picked index, if they are the same, it tries for a new random until they are different. Printing the 2 ints to screen on the False of the branch will even print 2 identical ints, though this is not possible. I also tried using a temporary int variable that stored the random int, and accessed that variable rather than the random, same problem. I also tried comparing the ‘Get’ value with self, same problem. What is going on here? What is the best method to achieve what I am doing? I have also gone as far as having an array of which actors are eligible to be picked, still does not work.
Edit: The RepNotify on the ‘Show Mystery Box’ variable just sets the visibility of the actor, I know that this part works properly.