How do i ignore my char in other actors line trace?

Have a sword with a line trace. How do i let it ignore my own char? If i do ignore self it refers to the sword and not to my char right?

There is get character or if you’re in the character panel you can add get mesh to get the mesh to ignore. Also try self might work

Edit: what you want is to add them ti an array and set it to ignore in the trace.

Get Character doesnt work in multiplayer and get mesh doesnt work because he gets the mesh of the sword and not of the character. Self does refer to the sword actor not to the character.

How are you attaching the Sword to the character? Could you add that reference to the array for the trace to ignore? If you can, please post a screenshot of how your sword is set up and we will try to find a solution.

I attached the sword like this:

thanks for the answers btw

I see, it’s just a simple spawn and attach. How are you doing the trace?

the trace is in the sword blueprint

hello, maybe you can add a check on your hit actor to see if other actor is your character/ pawn and the branch ignore or not.

When you get Hit Actor and cast to the enemy BP it will do whatever you want only to that actor, so you dont need to worry about self.

Here is my sword BP:

I’m using Rama’s plugin node for tracing but the logic is the same.

i tried your tip and he ignores my character but he ignored the enemy character aswell some how.

is how im calculating damage at the moment without the “cast to mycharacter”:

Create a variable inside your sword called “OwningPawn” and set the variable to be “exposed on spawn”. When you spawn in the mesh in your character you plug in a reference to self. That way when the sword spawns in it’ll have a reference to the character that spawned it.

In the sword BP you can then add the “OwningPawn” to your actors to ignore array.

1 Like

thanks pattym you are magic.