How do you stop and play animations instantly?

In my cutscene, a truck is driving through a neighborhood and thats seen from multiple angles. In that cutscene I use animations to move the truck and I change the camera angle using CFrame. Once a shot ends there are several things that happen:

  • The camera’s CFrame is changed
  • The old Truck animation stops
  • the Truck’s CFrame is changed (starting the new driving animation from a different CFrame)
  • The new Truck animation plays.

All of this is supposed to happen in the same moment with no delay. I use ContentProvider to preload the animations but sometimes I still get this problem:

There is an engine sound in the Trucks “Torso” with RollOffDistance. If an animation doesn’t end instantly (so the truck is still at the point where im changing the camera’s CFrame to), I can still hear the sound for short moment. and that makes the entire cutscene weird.

code looks somewhat like this

currentTruckAnimation:Stop(0)
Truck.HumanoidRootPart.CFrame = part.CFrame
currentTruckAnimation = Truck.Humanoid.Animator:LoadAnimation(newAnim)
currentTruckAnimation:Play(0)

this doesnt belong in scripting support

I have no idea, but when I used to teleport pets to players in my game, they would pick up velocity after the teleport, as if the engine just moved them really fast to my location. Maybe its something of the same thing.