Adding an upvector while still keeping momentum

I’m adding a dive for movement, and I want you to be able to keep your momentum when you chain a dive and a dash

  1. What do you want to achieve? Be able to get the current velocity of the player and then add it onto my upvector to keep maintain momentum

  2. What is the issue? I can’t find a way to place an upvector on the humanoidroot part without removing all speed.

  3. What solutions have you tried so far? I tried adding the angular velocity with the upvector but it errors saying "attempt to perform arithmetic (add) on vector3 and number.

Currently this is what I have

if momentumdive > 0 then
						diveforwardamt = diveforwardamt + momentumdive
						waitdiveamt = 0
						upvectoramt = 0
						
						hrp.Velocity = hrp.CFrame.UpVector*100 
						
					end
					
					hrp.Velocity = hrp.CFrame.UpVector*upvectoramt
					script.Dive:play()
					task.delay(waitdiveamt, function()
						hrp.Velocity = hrp.CFrame.LookVector*diveforwardamt 

Where is your script erroring? We can’t really help if you don’t give us much to work with. Since you are getting an addition error, it is probably because either your diveforwardamt or your momentumdive is a number instead of a vector3. Try printing these values and seeing what type they are.

Oh, sorry. I’m not looking for an error in my script, but I am looking for a way to boost the player upwards without losing their current velocity. the error I got was not from the script shown, but from a different script where i tried to add the assemblylinearvelocity to the upvector.

The current script was shown to display what I’m doing if that makes sense

Why not just try adding a vector to the player velocity then, as you cannot add straight numbers. Something like HumanoidRootPart.AssemblyLinearVelocity += Vector3.Up * someConstant, or if you want it to be up relative to the root part, you can do the root.CFrame.UpVector * someConstant as you did in the provided script.