Post by baroquedub on Dec 13, 2016 0:28:23 GMT
Apologies if this is a stupid question... new to Core GameKit and a few hours on the forums and watching videos hasn't helped me solve what is probably an easy fix.
I've got a Killable component working fine on my Player's projectiles. They spawn ok from a pool group and the Killable DeathTimer ensures that they despawn after a few seconds (This is a 3D VR game not a 2D platformer so I can't use Invisible Event to despawn):
My problem is I can't figure out how to despawn when hitting a non-killable object like a wall. These are being registered as collisions (their layers are included in the filter) and I can see the console logs telling me that hits are occurring:
How do I despawn the projectile and spawn a prefab (e.g. sparks), as you would in 'Deal Damage Prefab Settings' for a hit on another Killable, but when hitting a non-killable object?
It doesn't make sense to me to have to make all of my Environment meshes 'Killable'
So I thought I'd try adding an additional TriggeredDespawner component, with the Environment included in layer filters, but doing so seems to do nothing. And without the logging functionality of the Killable script, it's hard to tell what's happening. (Also couldn't see any videos or much info on TriggeredDespawner).
Finally I thought maybe I had to use a KillableListener, but after copying the subclass example from example scene 1 I couldn't see any methods that would detect "Not taking Damage because you've collided with non-Killable object". Looking at the API docs 'DeterminingScenario' might do the trick (?) but I have no idea how to use it...
Somehow it feels that I'm making this way more complicated than it needs to be.
Any help much appreciated!
I've got a Killable component working fine on my Player's projectiles. They spawn ok from a pool group and the Killable DeathTimer ensures that they despawn after a few seconds (This is a 3D VR game not a 2D platformer so I can't use Invisible Event to despawn):
My problem is I can't figure out how to despawn when hitting a non-killable object like a wall. These are being registered as collisions (their layers are included in the filter) and I can see the console logs telling me that hits are occurring:
How do I despawn the projectile and spawn a prefab (e.g. sparks), as you would in 'Deal Damage Prefab Settings' for a hit on another Killable, but when hitting a non-killable object?
It doesn't make sense to me to have to make all of my Environment meshes 'Killable'
So I thought I'd try adding an additional TriggeredDespawner component, with the Environment included in layer filters, but doing so seems to do nothing. And without the logging functionality of the Killable script, it's hard to tell what's happening. (Also couldn't see any videos or much info on TriggeredDespawner).
Finally I thought maybe I had to use a KillableListener, but after copying the subclass example from example scene 1 I couldn't see any methods that would detect "Not taking Damage because you've collided with non-Killable object". Looking at the API docs 'DeterminingScenario' might do the trick (?) but I have no idea how to use it...
Somehow it feels that I'm making this way more complicated than it needs to be.
Any help much appreciated!