How to play a sound once all 4 objects are found?
I apologize if a question like this has already been asked but I can’t seem to figure it out. I’m fairly new to UE4. But let’s say I have a cube, sphere, and a cylinder all in different parts in the level and once you find all three (in no particular order) then a sound plays.
I tried setting up a blueprint were you press “F” within the bounds of 1 of the three objects and it toggles a bool but I believe my issue comes down to referencing the three objects together and seeing once all 3 bools are true to play the sound.
Thanks for any and all help. :)
Use something like the game instance (if you need to access this from other BPs for more than just playing a sound) or the level blueprint which can easily create references to your selected objects in the world. When you collect one, have it set a bool to true. So you need 4 bools, 1 for each object and when you collect each one set the bool to true, and after have a branch node with an AND bool that checks all 4 booleans if they are true or not. If all 4 are true, execution flows through the branch and a sound is played. If any one are false, execution flows out the false pin and nothing happens.
answered Feb 21 '19 at 02:06 PM
Nebula Games Inc
Follow this question
Once you sign in you will be able to subscribe for any updates here