How to change player position in Y axis

Hi!!
Simple question - I want the player to move a specific distance upwards when a keyboard button is pressed (In my case, F) - How would I do this?

I’ve only found guides for teleporting forward by using CFrame’s position + LookVector, but this only applies to where the player is looking, and can’t be modified to use the Y axis afaik. I’m unsure how to do this using any position objects - Should I be modifying CFrame? HumanoidRootPart? Just the humanoid itself?

Any help would be greatly appreciated!

local MoveBy:CFrame = CFrame.new(0,5,0)
local RootPart:Part = char.HumanoidRootPart

--event connection here
RootPart.CFrame*=MoveBy

2 Likes

Thank you so much!! I greatly appreciate it

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.