How would I make the player move upwards when pressing a proximity prompt?

I’m trying to make a script inside of an attachment where interacting with the ProximityPrompt moves the player upwards for a limited amount of time (basic climbing). Using the help of a scripter friend (i’m a builder and am VERY unexperienced with scripting), I was able to come up with this:

script.Parent.ProximityPrompt.Triggered:connect(function(player)
	--trying to make a climb script
	local prompt = script.Parent.ProximityPrompt
	local character = player.Character
	local root = player.Character.HumanoidRootPart
	local velocity = Instance.new("VectorForce",player.Character.HumanoidRootPart)
	velocity.Attachment0 = root.RootRigAttachment
	velocity.Force = Vector3.new(0, 500, 0)
	script.Parent.ProximityPrompt.Enabled = false
end)

It functions, but the issue I have right now is that the player doesn’t move upwards when pressing the button, and instead just moves them higher when they jump like this:


The intention for the final result is to simply take control away from the player temporarily (which i know how to do but haven’t done yet) and make them move upwards with an animation.

There is a property called Velocity in the HumanoidRootPart. Maybe you can try messing with that Velocity?

I tried that, but it didn’t do much and I don’t know how to keep velocity staying at a constant number.

I think you have to loop it, so maybe you can for loop, so you can only run it a certain amount of times?

for count = 1,10,1 do
   -- Set Velocity
   task.wait(0.1)
end

That might help, but looking at the properties of a HumanoidRootPart, there doesn’t seem to be a property called Velocity and the value called AssemblyLinearVelocity doesn’t seem to change on a HumanoidRootPart, even with the loop on. I tried using this with both the Velocity and AssemblyLinearVelocity properties and nothing really happens so I personally think using a velocity instance would be better, but that doesn’t work too well either.

Does velocity work when the player is anchored? If it does, you could anchor the player to stop them from moving, animations still work when players are anchored.

Velocity only works on something unanchored, but you did give me a good idea. TweenService could maybe work for this.

Oh, Velocity property only works on the Client side, sadly.