I am not sure what you are trying to achieve here. But I assume you want to destroy a projectile when it hits the player character?
What I would do here is add an OnBeginOverlap event on the projectile. I will then try to cast the ‘otherActor’ param to the player character class. If that succeeds, you can check it against the stored ‘selfPawn’ variable and destroy the projectile (or anything else you want) if they are the same.
oh. I’sorry, my english is not good
when I turn my weapon from up to down ( in first person view) the MuzzelFlash socket become in player capsule collision and the projectile will be remove
I dont want happen this. I want shoot normal when the projectile become to own player collider
Ok, I think I understand you now. So you want to prevent your projectile from colliding with your own Player. Thats pretty simple there is a function called ‘IgnoreActorWhenMoving’ defined in the Component class. SO when you fire your projectile, get a reference to its collision component and add your Player into the list of Ignored Actors. You could do the opposite for your Player as well (ie add the projectile into the list of ignored actors for your player’s collsion component).
If I may high jack this thread somewhat please: The above info is just what I was looking for too. Great. One additional question though if I may: what about a networked scenario? Will calling “'IgnoreActorWhenMoving()” on a projectile spawned on the server also replicate this setting in some form so that there will also be no collissions on the client?
I think its depends on who the owner is. If both Actors are spawned on the server (ie The gun and the projectile), it will work as expected since the client will simply be replicating the position from the server. If both are spawned on client instead, same logic applies.
But if one of them is spawned at server and the other on client, then I am not quite sure. I haven’t tried that yet and unfortunately I cannot test it anytime soon. But I would say it might not work.