How can I make the projectile to ignore the owner(?)?
I have been studying UE4 for about 2 weeks, and just tried to create a basic projectile shooting system(?) and got some problems with the collision component.
I am trying to make the projectile to ignore the the shooter (or the owner(?)), and couldn't really figure it out by myself.
Here's what I have done so far:
This is a Fire Projectile function inside my ThirdPersonCharacter_BP. It will be called underneath "Event Graph" section when the "Left Mouse Button" is clicked as shown below.
And here's what I got for my Bullet_BP.
I thought that by ticking the "Pawn to Ignore" would solve the problem, but it actually did none....
According to what I have researched, "ignore actor when moving" node would solve this problem but I don't really get where and how I should implement this.
Can someone please solve my problem?
If you want them to ignore owner (by that i mean everyone use same projectile players and other pawns) you need to implement the check on collision event, since as i know default code does not have that. If you want them to ignore only player, you set player actor to one group and the rest of pawns to other and set projectile to igonre the other pawns group. I think your problem might be the fact that you don't have set proper object type to your actor (for example projectile is set to World Static).
answered Aug 19 '15 at 01:58 PM
When you spawn in the projectile, send in the "Self" variable as the instigator. Then in the projectile blueprint, add a check to your "on overlap" to make sure that the other actor is not the same as the instigator (using "get Instigator"). This worked for me, and I have my collision preset to overlap all dynamic.
If the problem is with the player's collision mesh instead of the projectile, you can set a variable to the spawned actor, and then check your own collision capsule against that variable to see if the touching projectile is equal to the one the player shot.
Add a owner to the spawn node, add it as input in your function and put the self node as parameter. To detect hit do the OnHit event in the projectile compare the OtherActor with the owner and if it is not equal deal your damage and everything else, else do nothing.
EDIT: You might have to cast the other actor to your charactertype and get its collision component and compare that. But I dont think so.
Follow this question
Once you sign in you will be able to subscribe for any updates here