Play a sound once on event tick used as a Linetrace by Channel
Hi guys! I have the next question.
I'm using a tick event for a LineTraceByChannel emulating the mouseover event with a ray. Everytime that the ray hit on an specific object a sound should be triggered once.
When I put the node "Spawn sound attached" to play the sound it plays but in a loop. So, i thought about to use "DoOnce" node.
If I use the "DoOnce" node the sound plays once but then not anymore and I need that this sound plays everytime that the ray hit on the object.
I don't know how to setup the "reset" property of DoOnce because if i use a Branch asking if the sound is playing it doesn't works.
Any clue?? Thanks!!!
asked Aug 12 '17 at 04:17 PM in Blueprint Scripting
Hi guys! thank you so much for the help. Finaly i solved it doing another Raytrace that evaluate the name of the object that is hit and then if the name is equal to the object name that has to play a sound, i Spawn the sound with DoOnce. If not, it reset and works good.
Now i have another problem. I need to do this with several objects so I was thinking to use an Array, but i don't know how to do it. May you help me with that please?
answered Aug 14 '17 at 08:49 PM
Once your trace hits a object, store that object in a variable class.
You should have your
If the bool is true when it is told to play, use a branch to not play the note.
Then when you mouse over the
answered Aug 12 '17 at 07:33 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here