Is there a direct way to prevent the actor that spawns a projectile from being hit by it but allow other actors of that same class to collide?

I am trying to create a projectile that players can shoot (that can collide with any player) but am running into an issue where the player that fires it frequently (but not always) gets hit immediately by it preventing it from traveling correctly. I have tried a couple of things but can’t come to a good solution.

First, I tried spawning the projectile a bit in front of the player, but this is problematic as it can lead to it being spawned behind objects when the player is directly against them.

I also tried disabling the collisions on the projectile at spawn and having it become active after a short period, but this would cause it to occasionally go directly through surfaces.

I then thought I could just make the player projectile collision be an overlap instead of a block channel and filter out any hit results that were the same as the owner on component overlap. This works well for projectiles that are destroyed on impact but does not work if I want the projectile to impact and then bounce off the player.

Does anyone know a good way to prevent the actor that spawns a projectile from being hit by it but allow other actors of that same class to collide still?

You can use IgnoreActorWhenMoving()

Use it on the projectile’s collision with the firing actor, and on the firing actor’s colliders with the projectile

you can also so use overlap instead of hit, this is good for penetration too and then just ignore the instigator

This ^^^^

Begin play → IgnoreActorWhenMoving(GetOwner())

The problem with overlap that I am having is that I don’t think that will let me simulate physics (like make the projectile bounce off the target). That definitely works for projectiles that I want to destroy on contact, but I am having trouble applying it to this context.

I didn’t know about that but it sounds like it should work. I will give it a try later, thanks!