i cast a spell, make it explode when Hit Event and i use a multi sphere trace for detect all pawn in a radius. All pawn in the radius are hit but the seem to be hit many times.
I think the problem came with the loop who seem to count every pawn in the game. (cast and hit event work) In an other spell i use the single sphere trace and no problem.
Someone have a solution or can explain me with that don’t work ?
Hello,
You may can replace multi sphere line trace by a collision sphere and do a “get overlapping actors”. Or check if actor is in a control array, if yes ignore it, if no, hit the actor and add it to the array.
Hi,
thx for your answer. i allready use a collision sphere for detect impact but i can expend the collision sphere radius because it explode on caster when i cast the spell.
i will try the control array but i not really see how to do that.
You can set location of your sphere location of caster: forward add sphere radius and eventually add a ignore character player.
For the array, you create an array of actor, do your loop from linetrace and check if array “contains” the actor (from actor hit) If yes you do nothing, if no you add damage and add it to array. At the end of the loop you “clear” the array.
I did this try in character. You can replace “get actor location” by “hit location” and it would be the same. Character is ignored in input “actors to ignore” in “sphere overlap actors”.
i just try your changes but that don’t do what i want to do.
The sphere overlap radius seem no apply at the impact. And if i change the sphere radius in the spell with the actors to ignore. the spell impact the caster.
I kept time to create a fps project and try both “get actor location” and “hit location” (which are supposed being same, except pivot point of projectile offset) in the FirstPersonProjectile blueprint and it worked fine for me with a print string and the ignore character. Trouble may comes from the “cast to mmocharacter” . It may comes from your spell too. Or something else you modified and i can’t see.