what math methods should i use to get the direction?
01 | i = 0 |
02 | m = 1000 |
03 |
04 | angX = script.Parent.Orientation.X; --90 |
05 | angY = script.Parent.Orientation.Y; --0 |
06 | angZ = script.Parent.Orientation.Z; --0 |
07 |
08 | dirX = math.cos(math.pi*angX/ 180 ) |
09 | dirY = math.sin(math.pi*angY/ 180 ) |
10 | dirZ = math.tan(math.pi*angZ/ 180 ) |
11 |
12 | print (dirX) |
13 | print (dirY) |
14 | print (dirZ) |
15 |
i tried switching around the cos sin tan log methods but no sucess
Why don't you use CFrame? Part.CFrame.LookVector
is might be what you are looking for and is easier to operate with. I don't know these methods you are using very well, but CFrame is a very good solution and it returns pretty much same resulst as you would expect with your method.
01 | i = 0 |
02 | m = 1000 |
03 |
04 | lookVector = script.Parent.CFrame.LookVector |
05 | print (lookVector) |
06 |
07 | repeat |
08 | wait( 2.5 ) |
09 | print ( 'wow' ) |
10 | workspace.launchingparttest.Position = workspace.launchingparttest.Position + lookVector |
11 |
12 | until i> = m |
13 | --doesnt move |
Also I am not sure but the reason why your method is not working is bc roblox uses Tait–Bryan angles instead of Euler angles (it's said here)