I made a CustomActor class that inherits from Actor, from which I created 3 more classes. On The CustomActor class I am using the Hit Event to call ApplyDamage.
When the actors hit each other, one of them is removed, but the other is not. It is as if one actor is being removed before the other one realizes that it is being hit or the Hit test is not working both ways. Simulation Generates Hit Events is Enabled for all and the Collision Preset is PhysicsActor. What am I doing wrong?
(Sorry, my phone cant display the blueprints in your link…)
Have you tried adding a short delay before destroying the actors?
If you haven’t done so already, you should also probably have the code to destroy/remove/damage an actor exist inside THAT actor. This prevents weird bugs where another actor kills something before that something can do its thing.
I have changed the links to screenshots. I have not tried a delay, but that doesn’t seem right. The code for the damage/destroy is on each actor as a blueprint component.
I will definitely try the delay. Thanks for the suggestion! I still feel like the hit event should call on each when the hit occurs and then each component should run the event script and go from there.
I cannot use delay because it is just delaying the same functionality. I added it before calling apply damage so I know the delay occurs right after the Hit Event and right before the actors receive the event.
The actor that instigated the hit needs to be set invisible with a delay until the other actor has a chance to run its code I would thinK. Or possibly in is both if you need to. Run your code and then destroy the actors.