So I am making a stealth game where if you throw a rock, it causes the NPCs to look at where the rock was thrown, for example if you threw the rock at a wall, all the NPCs in the area would hear it and look at the rock.
The problem is I don’t know what the math formula would be for the rotation/cframe of the NPCs HumanoidRootPart in order for it to be looking at the Raycast’s hit position. I have an image to display what I am trying to achieve.
The first position is the position of the NPC using its HumanoidRootPart.
The second position is a custom vector that is at the raycast position but also at the same height of the NPC