A Better way to destroy the projectile?

Hey guys, I managed to destroy the projectile before this video and was wondering if my way is better than the one in the video. Please do let me know

The way I did it was by using the “On System finished” event on ImpactBlast in the Projectile event graph and then destroying it’s owner.

Here’s what my OnHit() looks like.

{
LaunchBlast->Deactivate();
ImpactBlast->Activate();
ExplosionForce->FireImpulse();
CollisionMesh->DestroyComponent();
}

Totally agree that this is the way to go. Setting an arbitrary time for expiring a projectile seems a very odd way to do it.

What if two tanks are really close to each other? With a 3 second delay on firing, that’s still 3 extra shots which can be fired and be seen on screen, possibly passing through each other since the collision mesh has been removed.

What if I’m on a hill overlooking a valley and my shot take longer than the timer time to reach its target?

I get that the GetTimerManager function could be useful in certain situations ie an enemy spots you and will search for you for X seconds until they think you’ve gone away but the only time I can think of using this method for an object to exist in the world is when you’ve thrown something out of your inventory and it’s despawns after a set amount of time but for this, it doesn’t work.

This solution works just great! But is there a way to make the same in c++?

Privacy & Terms