i made a td movement system a while ago, it uses tweens, it works very well, but it doesnt play animations, is there a way i could make a movement system with working animations and no tweening?
Im guessing your npc enemies are going to be humanoids. If they are you can use walk to or even pathfinding to make things more interesting.
The other option would be to move the primary part in increments. (Take away the end pos from the start and times by a decimal of completion 1 meaning its finished)
If you want to move a character with a humanoid, just do this. (Source: API Reference):
local function walkTo(character, targetPoint, andThen)
local targetReached = false
-- listen for the humanoid reaching its target
local connection
connection = character.Humanoid.MoveToFinished:Connect(function(reached)
targetReached = true
connection:Disconnect()
connection = nil
if andThen then
andThen()
end
end)
-- start walking
character.Humanoid:MoveTo(targetPoint)
-- execute on a new thread so as to not yield function
spawn(function()
while not targetReached do
-- does the humanoid still exist?
if not (character.Humanoid and character) then
break
end
-- has the target changed?
if character.Humanoid.WalkToPoint ~= targetPoint then
break
end
-- refresh the timeout
character.Humanoid:MoveTo(targetPoint)
wait(6)
end
-- disconnect the connection if it is still connected
if connection then
connection:Disconnect()
connection = nil
end
end)
end
sorry, but i dont want the move to function, because it makes the npcs slide if they are fast.