I noticed that when an object is a handle, its orientation remains constant even if the player spins around. Im trying to make a weapon that fires in the direction of the gun with 0 y and z orientation, but I can't find a way to get the x orientation value of the handle. This is what I have.
local EggX = game.Workspace.DeathLauncher.Handle.Orientation.X missile.Orientation = Vector3.new(EggX, 0, 0)
(the gun shoots eggs) Maybe I could get the x orientation of the player, but I don't know how to do that. Any help on how to accomplish what I'm going for here?
Orientation gets pretty messy because it tends to breaks welds in scripts I would just change the CFrame instead, here's an example
missile.CFrame = CFrame.new(missile.Position, target.Position)
If you find that this leaves everything rotated the wrong way you can rotate them back by doing
missile.CFrame = (CFrame.new(missile.Position, target.Position)) * CFrame.Angles(0, math.pi/2, 0)
This will rotate the Y axis by 90 degrees, but you may rotate them as you want