Hey there, I am asking for advice on if there would be a better way to accomplish such a task. My current one is changing the speed but sometimes depending on how far he goes he just goes right through the wall. Here is what the script for my charge attack looks like:
local function charge(nearestTarget, distance, direction)
if not attacks.charge:FindFirstChild("Cooldown") and ghostHumanoid.Data.terrifying.Value == false then
local chargeAnim = ghostHumanoid.Animator:LoadAnimation(animations.charge)
humanoidRootPart.SFX.Attacks.charge_Attack:Play()
chargeAnim:Play()
humanoidRootPart.CanCollide = false
ghostHumanoid.WalkSpeed = 25
charging = true
wait(3)
humanoidRootPart.CanCollide = true
ghostHumanoid.WalkSpeed = 16
local cooldown = createCooldown(attacks.charge)
debris:AddItem(cooldown, attacks.charge.cooldownTime.Value)
chargeAnim:Stop()
end
end
Many thanks in advance!