raymond
Junior Member

Posts: 50
Posts: 50
|
Post by raymond on Sept 22, 2023 16:11:18 GMT
I am thinking about implementing your Killables script.
I am using OnTriggerExit functions in my game but it does not get called when objects are disabled within the trigger area. As a work around I move objects offscreen and then disable them.
Is there a way I can get OnTriggerExit to work with the killable script?
Thanks Raymond
|
|
|
Post by DarkTonic Dev on Sept 24, 2023 13:48:40 GMT
I think that's more of a general Unity question. But I think the answer is no. If you disable the object, none of its events will fire.
What do you want to happen when the trigger exits anyway? And why should it happen when the object it disabled?
|
|
raymond
Junior Member

Posts: 50
Posts: 50
|
Post by raymond on Sept 24, 2023 15:55:45 GMT
I am using this as an alternative for OnTriggerStay because OnTriggerStay is expensive. I have room colliders that keep track of if they are actively colliding with specific spawned game objects. When the other game object that is within the room collider gets disabled I move it off screen first so that the room collider's OnTriggerExit gets called and then I disable that object.
Its okay if killables wont work in this situation. I have an alternative method I can use as well.
|
|
|
Post by DarkTonic Dev on Sept 24, 2023 16:07:02 GMT
Thanks, I haven't heard why you want to use Killables specifically for what you need though. Are you wanting death prefabs to spawn?
-B
|
|