|
Post by catsploration on Dec 4, 2021 23:10:22 GMT
Hello! With MasterAudio set up to be persistent, how should we Play Sound from a NodeCanvas Behavior Tree node? Play Sound works great if the MasterAudio game object already exists in the scene, but on scene transitions, Sound Group references don't keep up. It looks like I could ask NodeCanvas to fire a custom MasterAudio event, but I wanted to double check if that's the right approach. Thank you!
|
|
|
Post by DarkTonic Dev on Dec 5, 2021 1:01:50 GMT
Regardless of Scene transitions, there should always be a Master Audio game object present. Not sure I understand the issue. Firing a Custom Event shouldn't be any better or worse aside from being able to trigger multiple sound events.
Thanks! -Brian
|
|
|
Post by catsploration on Dec 5, 2021 1:18:27 GMT
When I reload the scene, the sound group goes missing from the graph. I think this means I've created a reference to the MasterAudio game object that ends up getting destroyed on scene reloads? (I'm still super new to NodeCanvas as well.)
|
|
|
Post by DarkTonic Dev on Dec 5, 2021 1:27:37 GMT
If you're reloading your original scene the Master Audio game object was in, that shouldn't happen, unless it's a bug with NodeCanvas. Check if the Sound Group still exists when that happens.
If you're in a later Scene, reloading the Scene could have some variables to make something weird happen. Is your Master Audio game object that was persisting still there in that case?
Actually, in any case, check if the Sound Group still exists when that happens.
-B
|
|
|
Post by catsploration on Dec 5, 2021 1:47:49 GMT
Hmm, by pausing right after pressing reload scene, I can step into the first frame and see the behavior tree owner's node is referencing a sound group from the MasterAudio game object that ends up being destroyed in the next frame.
The persisting/original MasterAudio game object has all the sound groups and everything else works fine.
That sounds like expected behavior though, now that I've typed it out?
|
|
|
Post by DarkTonic Dev on Dec 6, 2021 0:37:12 GMT
Which Master Audio game object is the one being destroyed? Confused.
|
|
|
Post by catsploration on Dec 6, 2021 6:06:11 GMT
The Master Audio game object from the initial scene is the one that stays active, the Master Audio game object in the scene being stepped into is destroyed. The NodeCanvas behavior tree is referencing sound groups from the destroyed Master Audio game object.
I think I'm supposed to be setting up blackboard parameters? I don't have any at the moment. I'm still pretty confused with NodeCanvas.
I've got things working by setting up messages and triggering Custom Events, but if simply dragging and dropping sound groups is a feature for a persistent Master Audio game object, then maybe I've messed something up somewhere?
|
|
|
Post by DarkTonic Dev on Dec 6, 2021 16:33:57 GMT
Yeah it's normal that the one in the current scene gets destroyed. Perhaps NodeCanvas is caching it and never re-checking for a different one so it's broken. If it doesn't use the persisting one and stops working, NodeCanvas author would need to fix this most likely. He can contact me for assistance if needed.
|
|
|
Post by catsploration on Dec 6, 2021 23:08:28 GMT
Thank you, I'll let you know if I've figured out more!
|
|
|
Post by DarkTonic Dev on Dec 6, 2021 23:45:20 GMT
Cool, no problem.
|
|