Projectile colliding with player and how to get rid of it?

Hi, i havent been on unreal for a while and wanted to make a basic shooter.
When i launch a basic projectile from self while moving, my screen jolts and my player moves up a little.

I assume this is because of an unwanted collision with the player and the projectile? I have tried changing the collision settings on the projectile itself but when i get it to ignore the player, it ignores everything else too.

What can i do?

Use the “Ignore Actor When Moving” blueprint. Set the target to the spawned projectile and the actor to your player character. It should now ignore the player.

You can also add a custom collision channel and use that to filter out collisions.

1 Like

player moving could also mean physics interactions or the projectile has CanStepUpOn or CanEverEffectNaviation

also helps if you spawn the projectile away from the character (ie dont just use GetActorLocation)

could you show us an image of where your projectile is coming out of? presuming that the arrows is not far enough out then put it out farther, if it is far enough and because your shooting and moving then the issue is what auran13 said. You may also adjust the projectile to only effect other actors other then the player, do this by pulling off other actor from your projectile collision and get class, then run that through a = and put the acter you dont want it to effect and set it so when it hits your acter it does nothing but other actors you would want to have it effect them only. Run it through a loop and do a trace for all pawns/dynamic actors/ exc… exc…
Hope this helps!

1 Like

I have found the blueprint:


but then i am using the default pawn0 instance, so how do I reference that in the actor part? i have found the cast to default pawn but i dont know what to put in as the object? I also tried the get player pawn and hooked it up to the actor but it doesnt seem to work

Yes my projectile is coming out of the exact location of de default pawn:

I have tried changing the setting for both of those but they dont work so maybe ill just try spawning the projectile further away from the character

Add the ignore ignore after the spawn actor bp and pass in the player pawn.
Where are you spawning the projectile? If it is from the player then you can just pass in a reference to self.

I am spawning the projectile at the cooordinates of the actor but this is done in the level blueprint. is there a way to reference the DefaultPawn0 instance? I cannot find the blueprint for this actor

I’m guessing this projectile is launched from something right? Like a cannon or enemy or some point on the map. It would be better to move it inside of an actor and then you can have many of these projectile emitters on the map with their own logic / ammo etc.

Keeping this in the level blueprint is bad practice.

You can directly reference actors in the level bp (just drag them in from the outliner to the level bp) but they need to already be in the map, which doesn’t happen in the case of the player pawn (it spawns in during begin play)

You would need to rely on the “get actor from class” function to get the player into the level bp, but like I mentioned it’s bad practice and your level logic will become hard to handle pretty quickly.

okay thanks for the advice. So i should make an actor to play as and then make the projectile to launch from the newly created character BP?

If you want the an actor to shoot a projectile then have the actor have a function to fire:

  • check if the player has ammo before firing (I see you are using an ammo counter), if you have ammo reduce by 1.
  • it spawns the projectile at a location: usually a location relative on the actor like a gun muzzle etc
  • add the ignore logic to the newly spawned projectile passing in the actor that is spawning the projectile.
1 Like

thank you will work on that

You would also want to make sure the projectile is not launching from the character but from an arrow facing forward from the character that is at the end of the gun/wep that your using. unless your using the character, then us the arrow on the character.

use a + node on the spawn projectile and then go ahead and use the get forward rotation vector of the character and add to that for the end starting point so the projectile doesnt even touch the character. Generally this can be covered by looking at youtube, they have lots of tutorials.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.