Hey hey people,
TL;DR : We have a hitscan system to deal damage to enemies. We’re trying to make a turret deal splash damage. We can’t. I hope we can.
We’re in trouble once again… I put some days trying to figure this one by myself… But we can’t. And we have some pretty darn deadlines before us. So… Here we are.
This is our function. It is stored in an actor which has children. The actor is a turret and every child is a type of turret with different abilities. It works pretty fine atm.
And as youc an see, the way of dealing damage to our enemies are pretty simple…
In the event graph of the parent of all our other turrets, we basically do something like : “If you’re an enemy and overlap a collision sphere, you get shot instantly”. Like in good ol’ Doom for example. (Must have been just if you’re on screen and a a certain distance back then, but you get the idea)
This is in the function “Attack Enemy”. The idea here is to have a Collision Sphere stored in the Parent Turret. Each time it scans and damage an enemy, the Collision Sphere is moved to the enemy it just hits. Then, every enemy overlaping this sphere is going to take damage… But We can’t get the last part… “All the enemies overlaping this sphere”.
Another thing we tried was to create a projectile that would be destroyed once it hits an enemy. THEN, draw a sphere and any enemy overlaping that sphere would be destroyed. It works perfectly… BUT… We can’t get a reference to the function of another actor…
To help you understand : Parent_Turret > Children_Turret > Projectile.
It’s pretty difficult to make references from the projectile to the Parent_Turret since the projectile is not a children nor stored in the Parent blueprint. And we can’t figure how to get a function from them either.
I hope it makes sense. If it does not, don’t hesitate, I would try to be clearer.
Thank you.