Projectile Offset Hit Detection - Sprint 5


Author: Tyler Sessler

Enemy projectiles  are relatively simple at its core- spawn an actor with collision, update the direction, and check for overlaps. Most of the time when finding it's spawn location, you find the owner's respective position and call it a day. You may need at attach it to a bone/socket as well. This works very well with fast, small projectiles, such as bullets.
The first issue I ran into was the size of my projectile. It is an ability cast similar to the length and size of a large arrow. When I spawned the projectile at the owner's location, half of it was sticking out of her back. In order to fix this, I offset the spawn location by finding the actor's forward vector and multiplying it by an offset.No Offset

No Offset
Now that we have the projectile spawning in front of the enemy, it looks much better. However, my projectile checks for collisions on overlap begin. If I stand close to the enemy, the projectile spawns inside of me, therefore never calling the initial overlap. To fix this, I created a small function that is spawned right when the projectile spawns. This function checks all overlapping actors, then filters out the player to apply damage.

Get Proving Grounds

Leave a comment

Log in with itch.io to leave a comment.