How can i make the player move up then down

I want to make a system so the player moves forward as well as up then gravity takes into place and drags you back down i have tried using bodyvelocity but i cant get it to work (this is r6)

1 Like

i pretty much mean i want them to move in a curve

you can use a sine wave and then set the players position property by doing:

local Character = -- Player's character.
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
HumanoidRootPart.Position = -- Position of the sine wave.

here is the finished code:

local Character = -- Player's character.
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
local index = 0
while true do
	wait(0.01) 
	local currentTime = tick()
		local Y = math.sin(currentTime+loopNumber)
		HumanoidRootPart.Position = Vector3.new(0,Y,0)
	end
end

NOTE: this is not tested please fix some stuff.

what do you mean by “loopNumber”? (i know im stupid)

oh sorry replace that with index and add index += 1 after the wait. oof

im going to do some testing with this thanks!

1 Like

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