I have a kamehameha script and I'm trying to make it so it faces the mouse but I realized roblox says the long part of the cylinder is the front so I need it to rotate itself 90º but idk how.
launch = Instance.new('Part', ctr) launch.Shape = 'Cylinder' launch.Size = Vector3.new(75, 5, 5) launch.CFrame = ctr:FindFirstChild('Torso').CFrame * CFrame.new(0, 0, -37.5) launch.BrickColor = BrickColor.new('Toothpaste') launch.Material = 'Neon' launch.CanCollide = false launch.Anchored = true launch.CFrame = CFrame.new(launch.CFrame.Position, m.Hit.Position)
sorry if it's indented. I was too lazy to remove the indentation from the script.
just make a offset to rotate it 90º using CFrame.Angles()
, also use local variables and the parent argument of Instance.new()
is deprecated; set the parent last.
launch.CFrame = CFrame.new(launch.CFrame.Position, m.Hit.Position) * CFrame.Angles(0,math.rad(90),0) -- or you could divide pi by 2