#how to create momentum? any ideas?

1 messages · Page 1 of 1 (latest)

winged thistle
#

really dont know where to begin with
im trying to make a double jump but when you jump a second time you create momentum, like if you move fast the momentum will send you foward and give you inertia and stuff

marsh stump
#

Inertia doesn’t mean the same thing as momentum btw.

acoustic fern
#
on every frame (RunService.Heartbeat):
    currentVelocity = HumanoidRootPart.AssemblyLinearVelocity

    if player is pressing movement keys (UserInputService):
        movementDirection = Vector3 from input
        apply VectorForce or LinearVelocity with Force = movementDirection * acceleration
    else:
        currentVelocity = currentVelocity * dragFactor (e.g. 0.9)
        apply VectorForce opposite to velocity (friction/drag)
#

Or you could get their current velocity and add a boost on the second jump specifically

You could even base how much of a boost with some sort of formula depending on how fast they were going