woloexe
(wolo)
January 1, 2021, 6:19am
#1
zombie = script.Parent.HumanoidRootPart
node2 = game.Workspace.Map.Nodes:FindFirstChild("2")
node3 = game.Workspace.Map.Nodes:FindFirstChild("3")
node4 = game.Workspace.Map.Nodes:FindFirstChild("4")
node5 = game.Workspace.Map.Nodes:FindFirstChild("5")
node6 = game.Workspace.Map.Nodes:FindFirstChild("6")
node7 = game.Workspace.Map.Nodes:FindFirstChild("7")
node8 = game.Workspace.Map.Nodes:FindFirstChild("8")
node9 = game.Workspace.Map.Nodes:FindFirstChild("9")
node10 = game.Workspace.Map.Nodes:FindFirstChild("10")
for i = 0, 1, 0.01 do
wait()
zombie.CFrame = zombie.CFrame:Lerp(node2.CFrame, i)
end
for i = 0, 1, 0.01 do
wait()
zombie.CFrame = zombie.CFrame:Lerp(node3.CFrame, i)
end
so i have two issues with this:
it does not move to the other point in a constant speed
the speed is determined by percentage of the distance (i want a fixed speed)
how can i fix these two issues? ive heard that i need to use math but havent heard much other than that
woloexe
(wolo)
January 1, 2021, 6:19am
#2
i know that it isnt very efficient rn with variables and stuff but i just want it working for now
heII_ish
(heII_ish)
January 1, 2021, 6:31am
#3
You can use tweens for a linear transition with constant speed
TweenService is used to create `Class.Tween`s, which are used to interpolate,
or tween, the properties of instances. `Class.Tween`s can be used on any
object with compatible property types.
1 Like
woloexe
(wolo)
January 1, 2021, 6:32am
#4
someone told me that tweens skip and lerps dont but from what i see they both skip
is there something im doing wrong?
heII_ish
(heII_ish)
January 1, 2021, 6:33am
#5
What exactly do you mean by “skip”?
woloexe
(wolo)
January 1, 2021, 6:33am
#6
by that i mean little increments of teleportation until it gets to where it needs to be
i do believe that its inevitable to have that though
heII_ish
(heII_ish)
January 1, 2021, 6:36am
#7
The delay shouldn’t be very noticable, especially with tweens. From my experience tweens look pretty smooth on the server unless you have too many tweens playing at the same time.
woloexe
(wolo)
January 1, 2021, 6:36am
#8
yeah i prefer tweens but i wanted to try out lerps
i think im just going to stick with tweenservice lol