I need a script (preferably Javascript) that’ll play audio when the player looks at an object, presses E, with the mouse over the object, and is not 5 (units?) away from it on the x and z coordinates. I’ve tried some other scripts online, but either they don’t work, or I just suck with scripting in general.
function OnMouseOver(){
if(Input.GetKey(“e”));
audio.Play();
}
OK this should work according to what I’ve found (no guarantee). and sorry this is a week later.