Im having trouble with my combat system , I made one simple before where it just casted a raycast and it worked , But now i noticed it was kinda buggy , and you could even hit yourself sometimes .
Well basicly I want to find all objects in an arc infront of me and send the damage input , yet i cant figure out how to do it
(Im a java script coder)
to be more precise :
get distance between your 2 objects.
get dot product between the front vector of your โweaponโ and the weapon-to-object direction vector.
Do something by testing these 2 values.
(for example, apply damage if dotproduct > 0 and distance <10)
โฆ