How would I have something fire when a part is in the region of 90 degree angle in front of a part? I think I have to do something with math.rad, math.deg, magnitude, and Region3. Here is a (fairly messy) picture of describing what i want to happen:

https://gyazo.com/f0182173181dcda7c2c22b95c89045eb

Here is what im doing right now (although im sure it is completely wrong)

local Distance = 50
local Equation = math.rad(50 / 90)
local playerDistance = plr.Character.HumanoidRootPart.Position
 if (playerDistance - script.Parent.HumanoidRootPart.Position).magnitude <= Equation then
	--do stuff
else
	--do more stuff
end
	

4 comments

0

I'd probably just have a cylinder/sphere with .Touched event listening if it's the Player's Character that comes to exist in proximity over time.

0

If it's the area that comes to exist at a point in time then I'd probably Region3 at that time and then use the distance (radius) from the centre of the Region to determine true existence.

0

Get the script to run a checkup on the HumanoidRootPart's orientation of the player, then just proceed.

0

How would I do that?