-
What do you want to achieve? I’m testing a Boss Battle system, starting with creating parts.
-
What is the issue? The part will just teleport to the area, even when I use wait()
local lavaBall = game.ReplicatedStorage.LavaBall
function attack1()
local lavaBallClone = lavaBall:Clone()
lavaBallClone.Parent = game.Workspace
lavaBallClone.CFrame = script.Parent.HumanoidRootPart.CFrame
local lv = lavaBallClone.CFrame.lookVector
for count = 1,10 do
lavaBallClone.CFrame = script.Parent.HumanoidRootPart.CFrame + (lv*1)
end
end
attack1()
There’s no errors, so I don’t know what the mistake is.
Look, I don’t understand right anymore, if the problem is that the instance is instantly teleported to the location, try using a Lerp or a Tween on the instance or a BodyVelocity you know
Have you heard of using TweenService
? It has the ability to smoothly transition properties without having to use loops of any sort
local lavaBall = game.ReplicatedStorage.LavaBall
local TweenService = game:GetService("TweenService")
function attack1()
local lavaBallClone = lavaBall:Clone()
lavaBallClone.Parent = game.Workspace
lavaBallClone.CFrame = script.Parent.HumanoidRootPart.CFrame
local lv = lavaBallClone.CFrame.lookVector
local ProjectileTween = TweenService:Create(lavaBallClone, TweenInfo.new(1, Enum.EasingStyle.Linear), {Position = script.Parent.HumanoidRootPart.CFrame + lv * 10})
ProjectileTween:Play()
end
attack1()
Also using a loop without any wait()
would result it in travelling instantly, which is 1 of your issues
1 Like
Also using a loop without any wait()
would result it in travelling instantly , which is 1 of issues
Yes, I also said “The part will just teleport to the area, even when I use wait()”
It still seems like you’re calling the function way too quickly to begin with in the first place, unless if you’re activating it as a specific interval
Something like a Tween, or Physics-based object can work fine on moving the lavaBallClone