I am trying to make it where if you shift lock the wave aims wherever your aiming
The wave is teleporting you whenever you shift lock I know it is probably because the CFrame counts for position too but I cannot find a way to make it only count for direction
I tried using raycast and other stuff that I am blanking out on
local RS = game:GetService("ReplicatedStorage")
local TS = game:GetService("TweenService")
local cHandler = require(RS:WaitForChild("Universal Handler"))
local kHHandler = RS:WaitForChild("Kamehameha Handler")
local kHWave = game.Workspace:WaitForChild("Kamehameha Wave")
local WaveTween;
kHHandler.OnServerInvoke = function(player, abilityID, isShiftLock, mouseCFrame, cameraPos)
print("release")
print(isShiftLock)
local humanoidRootPart = player.Character:WaitForChild("HumanoidRootPart")
humanoidRootPart.Anchored = true
local rootPartRotation = humanoidRootPart.CFrame * CFrame.Angles(0, math.rad(180), 0)
local waveClone = kHWave:Clone()
if humanoidRootPart == nil then
error("Cannot find Humanoid Root Part")
return
end
local cFrameLookAt = CFrame.lookAt(Vector3.new(mouseCFrame.X, mouseCFrame.Y, mouseCFrame.Z), Vector3.yAxis)
if isShiftLock == true then
humanoidRootPart.CFrame = cFrameLookAt
end
waveClone:PivotTo(humanoidRootPart.CFrame * CFrame.new(0,-15,-3.5))
--[[ you cannot subtract or add cframes can only multiply and divide(I think divide idk)]]
waveClone.Parent = game.Workspace
for num,child in waveClone:GetChildren() do
child.Name = "Wave"
child.CanCollide = false
child.Rotation = player.Character:WaitForChild("HumanoidRootPart").Rotation + Vector3.new(0,90,0)
WaveTween = TS:Create(child,TweenInfo.new(2,Enum.EasingStyle.Sine,Enum.EasingDirection.Out),
{Size = Vector3.new(child.Size.X + 160,child.Size.Y,child.Size.Z), CFrame = child.CFrame + humanoidRootPart.CFrame.LookVector * 80})
WaveTween:Play()
WaveTween.Completed:Connect(function()
child:Destroy()
humanoidRootPart.Anchored = false
end)
end
end