I am trying to find out which side is touched every time a player touches another player. (Did they touch the player from the right,left,front, or back?). How would I accomplish this?
1 Like
You will probably need to use Vector3:Dot here. You get the look vector of the touched part and the humanoid root part of the player, and see how much they are facing in the same direction. I am not great with this, so I recommend this guide. The Ultimate Guide to Vector3:Cross() and Vector3:Dot()
Another way you could do this is by adding multiple parts outlining the actual part, and when these are touched you already know where it was touched.
You want to create a raycast in every direction and see which raycast finds an instance.
1 Like