Hey everyone, so recently i've been trying to create a beam, that starts from the player and goes towards the mouse. I want the player to also be able to rotate towards the mouse as the beam is being fired.
Here's my current progress:
https://photos.app.goo.gl/46YabKKzf2FX9FDR8
The problem is that whenever I try to roate the player, the player glitches out,
I just need a push in the right direction on how rotate the player the correct way. So far, the script creates the beam and updates the beam's CFrame.
Here is an example of how you can do it i suggest editing it and changing it to your needs for example if your using a key hold function replace it with the loop.
local Char = game.Players.LocalPlayer.Character local mouse = game.Players.LocalPlayer:GetMouse() local RootPart = Char:WaitForChild('HumanoidRootPart') local BG = Instance.new("BodyGyro") BG.CFrame = RootPart.CFrame BG.MaxTorque = Vector3.new(math.huge, math.huge, math.huge) BG.P = 30000 BG.Parent = RootPart while true do RootPart.BodyGyro.CFrame = CFrame.new(RootPart.Position, mouse.Hit.Position) wait(0.1) end