How do i prevent my character from hitting himself?

I am making a 2D multiplayer game. When i use my sword i sometimes hit myself. How do i make the sword only hit other players?

What collision method are you using? Some of the collision blueprint nodes have a setting for excluding yourself. If they don’t just add a Branch node that checks to see that the object it is hitting is not your character. Then only proceed if that is true.

what blueprint nodes have the setting to exclude myself?

Line and Sphere trace nodes have an ignore self checkbox. If you are using Begin Overlap just check to make sure the Other Actor pin isn’t yourself.

I am using OnComponentHit. but when i use my sword sometimes it collides with me. I want it to check that i am the one that used it but i dont know how. The line and sphere trace nodes aren.t helpful to me with my current blueprints and begin overlap is also not useful for the same reason.

I just made it that it is checking if any player is using their sword with a variable. This will also be a blocking system at the same time.