hi im ctg
currently, I and @Saket9 is working on a tower defense system and we making an enemy system
but the enemy in some waypoint when rotation is very weird
here is the video how it weird 2023-04-25 11-39-23_Trim
also here is the code:
function tweenTable.NextWaypoint()
if enemy.Parent then
local WaypointPart = Waypoints[EnemyWaypoints.Value]
local tweenTime = tweenTable.GetTime(WaypointPart)
local tweenInfo = TweenInfo.new(tweenTime, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0)
local tweenInfoRotation = TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0)
local tweenRotation1 = TweenService:Create(EnemyRoot, tweenInfoRotation, {Orientation = Vector3.new(EnemyRoot.Orientation.X,WaypointPart.Orientation.Y, EnemyRoot.Orientation.Z)})
local tween = TweenService:Create(EnemyRoot, tweenInfo, {Position = WaypointPart.Position})
tween:Play()
tween.Completed:Connect(function()
tweenRotation1:Play()
tweenRotation1.Completed:Connect(function()
tweenTable.TweenComplete()
end)
end)
end
end
tweenTable.NextWaypoint()
end