when I don’t move the camera my kamehameha works well
if i start moving the camera the beam won’t follow how i can fix it please?
local Meshes = script.Meshes
local Animations = script.Animations
local Sounds = script.Sound
local TweenService = game:GetService("TweenService")
local Debris = game:GetService("Debris")
local AnimCharge = Animations.KameHold
local KamehamehaModule = {}
function KamehamehaModule.Charge(Folder,FolderBeam,Humrp,Player,RightArm,Character,KameHold,KameRelease,Humanoid,FireSound)
KameHold:Play()
local ChargeIn = Meshes.KamehamehaCharge:WaitForChild("In"):Clone()
ChargeIn.CFrame = RightArm.CFrame * CFrame.new(0,-1.5,0)
ChargeIn.Size = Vector3.new(0,0,0)
ChargeIn.Parent = Folder
local ChargeOut = Meshes.KamehamehaCharge:WaitForChild("Out"):Clone()
ChargeOut.CFrame = RightArm.CFrame * CFrame.new(0,-1.5,0)
ChargeOut.Size = Vector3.new(0,0,0)
ChargeOut.Parent = Folder
local weld = Instance.new("ManualWeld")
weld.Part0 = ChargeIn
weld.Part1 = RightArm
weld.C0 = weld.Part0.CFrame:toObjectSpace(weld.Part1.CFrame)
weld.Parent = weld.Part0
local weld = Instance.new("ManualWeld")
weld.Part0 = ChargeOut
weld.Part1 = ChargeIn
weld.C0 = weld.Part0.CFrame:toObjectSpace(weld.Part1.CFrame)
weld.Parent = weld.Part0
local ChargeSound = Sounds.Charge:Clone()
ChargeSound.Parent = Folder
Debris:AddItem(ChargeSound,3,5)
TweenService:Create(ChargeIn,TweenInfo.new(3),{Size = Vector3.new(2,2,2)}):Play()
TweenService:Create(ChargeOut,TweenInfo.new(3),{Size = Vector3.new(2.2,2.2,2.2)}):Play()
ChargeSound:Play()
--TweenService:Create(ChargeIn,TweenInfo.new(5),{Size = ChargeIn.Size * 6}):Play()
--TweenService:Create(ChargeOut,TweenInfo.new(5),{Size = ChargeOut.Size * 6.2}):Play()
Humanoid.WalkSpeed = 0
Humanoid.JumpPower = 0
Humrp.Anchored = true
--Humanoid.AutoRotate = false
wait(3,5)
ChargeSound:Stop()
ChargeIn:Destroy()
ChargeOut:Destroy()
FireSound:Play()
KameRelease:Play()
wait(0.5)
KameHold:Stop()
end
function KamehamehaModule.Fire(Folder,FolderBeam,Humrp,Player,RightArm,Character,KameHold,KameRelease,Humanoid,FireSound)
KameRelease:GetMarkerReachedSignal("Fire"):Connect(function()
local Center = Instance.new("Part")
Center.CFrame = Humrp.CFrame * CFrame.new(0,0,-4)
Center.Size = Vector3.new(0.1,0.1,0.1)
Center.Anchored = true
Center.CanCollide = false
Center.CanTouch = true
Center.Massless = true
Center.Parent = Folder
local FireIn = Meshes.KamehamehaFire.Front:WaitForChild("In"):Clone()
FireIn.CFrame = Humrp.CFrame * CFrame.new(0,0,-4)
FireIn.Size = Vector3.new(5,5,5)
FireIn.Parent = Folder
local FireOut = Meshes.KamehamehaFire.Front:WaitForChild("Out"):Clone()
FireOut.CFrame = Humrp.CFrame * CFrame.new(0,0,-4)
FireOut.Size = Vector3.new(5.2,5.2,5.2)
FireOut.Parent = Folder
local FireShock = Meshes.KamehamehaFire.Front:WaitForChild("Shock"):Clone()
FireShock.CFrame = FireOut.CFrame * CFrame.new(0,0,1.5)
FireShock.Size = Vector3.new(9, 4.8, 9)
FireShock.Orientation = FireShock.Orientation + Vector3.new(90,0,0)
FireShock.Parent = Folder
local weld = Instance.new("ManualWeld")
weld.Part0 = Center
weld.Part1 = Humrp
weld.C0 = weld.Part0.CFrame:toObjectSpace(weld.Part1.CFrame)
weld.Parent = weld.Part0
local weld = Instance.new("ManualWeld")
weld.Part0 = FireIn
weld.Part1 = Humrp
weld.C0 = weld.Part0.CFrame:toObjectSpace(weld.Part1.CFrame)
weld.Parent = weld.Part0
local weld = Instance.new("ManualWeld")
weld.Part0 = FireOut
weld.Part1 = Humrp
weld.C0 = weld.Part0.CFrame:toObjectSpace(weld.Part1.CFrame)
weld.Parent = weld.Part0
local weld = Instance.new("ManualWeld")
weld.Part0 = FireShock
weld.Part1 = Humrp
weld.C0 = weld.Part0.CFrame:toObjectSpace(weld.Part1.CFrame)
weld.Parent = weld.Part0
local BeamIn = Meshes.KamehamehaFire.Beam:WaitForChild("In"):Clone()
BeamIn.CFrame = FireIn.CFrame * CFrame.new(0,0,-1)
BeamIn.Size = Vector3.new(2, 4.671, 4.671)
BeamIn.Orientation = BeamIn.Orientation + Vector3.new(0,90,0)
--BeamIn.Anchored = true
BeamIn.Parent = FolderBeam
local BeamOut = Meshes.KamehamehaFire.Beam:WaitForChild("Out"):Clone()
BeamOut.CFrame = FireOut.CFrame * CFrame.new(0,0,-1)
BeamOut.Size = Vector3.new(2.2, 5.465, 5.465)
BeamOut.Orientation = BeamOut.Orientation + Vector3.new(0,90,0)
--BeamOut.Anchored = true
BeamOut.Parent = FolderBeam
local weld = Instance.new("ManualWeld")
weld.Part0 = BeamIn
weld.Part1 = FireIn
weld.C0 = weld.Part0.CFrame:toObjectSpace(weld.Part1.CFrame)
weld.Parent = weld.Part0
local weld = Instance.new("ManualWeld")
weld.Part0 = BeamOut
weld.Part1 = FireOut
weld.C0 = weld.Part0.CFrame:toObjectSpace(weld.Part1.CFrame)
weld.Parent = weld.Part0
for i, v in pairs(FolderBeam:GetChildren()) do
if v.Name ~= "BeamIn" and v.Name ~= "BeamOut" then
local goal = {}
goal.Size = v.Size + Vector3.new(200,0,0)
goal.CFrame = v.CFrame * CFrame.new(100,0,0)
goal.Anchored = true
Humanoid.AutoRotate = false
local info = TweenInfo.new(6, Enum.EasingStyle.Sine)
local tween = TweenService:Create(v,info,goal)
tween:Play()
end
end
end)
end
function KamehamehaModule.Explosion(Folder,FolderBeam,Humrp,Player,RightArm,Character,KameHold,KameRelease,Humanoid,FireSound)
wait(9.5)
KameRelease:Stop()
Humanoid.WalkSpeed = 16
Humanoid.JumpPower = 50
Humrp.Anchored = false
Humanoid.AutoRotate = true
end
return KamehamehaModule