Hi! In my atb battle system, I'm trying to create a special effect upon casting animation (using prefab and casting game event), but I want the prefab to be destroyed once the casting is completed or the casting got cancelled. Is there any way I can somehow access the prefab spawned in the cast event at the cast cancel event and destroy it, and also at the ability battle event to destroy the prefab? Or is there a solution for this?
Thanks!
Alternatively if it's a skill you can select the starting node of the battle event and choose "remove prefabs" or something, it automatically deletes prefabs after the event ends (not always ideal)
An alternative solution would be storing them in Global Objects, e.g. using a Change Found Objects node.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
I tried the Global Objects method but have no idea how to retrieve the object from another event. Any hint? This is what I did so far.
Under Spawn Prefab, Add Found Objects, input some name (value type: value, change type: add), check use Global Objects
Small extension on the global objects - you can store any game object in a global objects list, which are identified by the key you're using. You can reuse the stored objects by just using the global objects with the same key, e.g. in different events.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!