of     1   

edenojack
#159718539Wednesday, April 08, 2015 10:19 PM GMT

I'm trying to find if a player's Torso is within 90* of another part, but I have no idea how to do this :S So, 1. Is there any way to check this through raycasting, from the part 2. If there isn't a viable method with Raycasting, what other methods should I look at?
mycheeze
#159719060Wednesday, April 08, 2015 10:26 PM GMT

local Part1, Part2 = 'another part', Torso local B = ((Part1.Position - Part2.Position):Dot(Part1.CFrame.lookVector) < 0) k there ya' go m80 >Part 1 is the part that is looking, part2 is the torso just change the actual part1 and part2 variables to be the legitim8 workspace area
edenojack
#159719484Wednesday, April 08, 2015 10:31 PM GMT

At a guess, changing 0 will change the angle? so 90* would need that changed to 90? (Never worked with :Dot() before)
mycheeze
#159719556Wednesday, April 08, 2015 10:32 PM GMT

local P1, P2 = Workspace.Part1, Workspace.Part2 local A = P1.Position - P2.Position local B = (A:Dot(P1.CFrame.lookVector) < 0) print(B) >use dis in le~ c0mmand bar, make sure there is two parts in the workspace with the following names 'Part1' and 'Part2' then make sure to change the surface of the two to SteppingMotors, to better understand which side of the brick is the front. if it is in sight, b will be true, if nawt, it will b fals'
edenojack
#159719623Wednesday, April 08, 2015 10:33 PM GMT

fenk chu
mycheeze
#159719714Wednesday, April 08, 2015 10:34 PM GMT

o & no, the 90 will mess it up, if you were to have the part looking and face it in the complete oppis8 direction, it would still be true.
mycheeze
#159720107Wednesday, April 08, 2015 10:38 PM GMT

to put it simply, if one part was in 0, 0, 1 (being the looking part) and the second is in infinite negative/positive, infinite negative/positive, 1.001, it would be true but if you took the same vector, of the second and subtracted .001 to make it 1, it would be false
edenojack
#159720737Wednesday, April 08, 2015 10:45 PM GMT

Is there a way of making changing the size this checks? It is still saying true even if the part is well out of a 90* angle of the part. I am trying to find if a part is 45* either side of a parts lookvector, making a 90* area.
mycheeze
#159720880Wednesday, April 08, 2015 10:47 PM GMT

idk ;-; I guess u w00d just mess around with the :Dot portion

    of     1