Hello,
Making good progress, just was wondering if in an event if there was a way to if you had found multiple objects, only activate one designated one with the 'Active Object' node and also Deactivate a designated object the same way.
I tried removing the found object I want activated later in the event, but it appears that doesn't work once it is deactivated so once it activates in my event it ends up turning all of the found objects back on rather than just the one I want.
Found objects are just a list of all the objects you put into it, so adding or removing an object will just do that. Once they're disabled, Unity will not be able to find them via the Search Objects node, though - so you'll have to keep that selected object somewhere to be able to access it.
There are also the global objects available, which keep the object references even after the event ended (but they'll still be gone when the game object is destroyed, e.g. by changing scenes).
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
I'm using a node at the beginning of my event to Search and Add objects by name. I have two of these nodes to find two separate objects that are in the scene but i want deactivated until they are needed in the event.
So I have another node deactivating the found object's and then when I need them in the event I have a activate object node, but this activates both the found objects when I only need one at that time and then need one to activate later.
I tried searching, deactivating, and then removing one object so I could later read the object through a search but since it was deactivated it wouldnt let me add it to my found objects.
Sorry if what I'm trying to do isn't super clear, I'm trying to explain it best I can
Edit: One other thing I want to add just to see if I can get this answered when you are available, if I have a sound Paused with the "Stop Sound" node, how do I get it to resume playing again? I tried using another Play Sound node and it did resume playing but it starting looping the same track again over on top of it so it was playing two of the same track with one slightly delayed. Thanks again gamingislove for all you do.
Otherwise, you'll have to keep the object stored somewhere (e.g. found/global objects or selected data) to be able to still use it - as said, searching deactivated game objects isn't possible, Unity can't find them any longer ...
As for continuing playing a sound - I don't think there's a designated node available for that, but you can use a Call Function node for this.
- component name: AudioSource
- function name Play
no parameters :)
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!