Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to remove momentum (velocity) of a model?

I have been using the INSPARE a-chassis car model to make a car game, but I have runned into a problem, I have this code to teleport the car model:

local car = game.Workspace.TCar
car.PrimaryPart = car.DriveSeat


function Re1()
	print("Moving car")
	car:SetPrimaryPartCFrame(CFrame.new(0, 25, 0) * CFrame.Angles(0, math.rad(270), 0))

end


script.Parent.Touched:Connect(Re1)

but when it gets telported, it conserves it's momentum,(keeps moving as it did previously), I need to do something to stop the car completly, some help would be really appreaciated.

I have tried: To set a max speed on it's primary part(won't work), to set a velocity on it's primary part, (won't work since it's anchored (I think) and to anchor it momentarily (won't work since it's allready anchored)

Again, help would be greatly appreciated.

2 comments

0

Part.velocity?

0

Yes, it won't work, I belive because of the way the INSPARE chassis is coded. Applaying force does work to push the object, perhaps a complex force vector could solve it, althought that seems very overcomplicated to me

1 answer

I think I have a solution, despawning and respawning the car in the wanted position, and teleported and sitting the player into the newly spawned car. I will code it later, could anybody tell me how taxing will this be in terms of resources, (when compared to just teleporting)?

This discussion is preserved as it was. New answers, comments, and votes are closed.