How to make CFrane:Lerp() ignore Y axis?

I want to make a bunny that jumps all the time and moves to random positions using CFrame:Lerp().
The problem is that since the bunny jumps all the time, :Lerp() would make the jumping wanky.
The only solution I can think of is to somehow make :Lerp() ignore the Y axis.

Is there any way to achieve that? Thanks.

Can you send your current script?

walk = function()
	while true do
		local WalkToCFrame = script.Parent.Body.CFrame * CFrame.new(math.random(-30,30),0,math.random(-30,30))
		local CFrameDifference = script.Parent.Body.CFrame*WalkToCFrame:Inverse()
		for i = 0,1,0.1 do
			script.Parent.Body.CFrame = script.Parent.Body.CFrame:Lerp(WalkToCFrame, i)
			wait()
		end
		script.Parent.Body.CFrame = WalkToCFrame
		print(CFrameDifference)
		wait(math.random(3,7))
	end
end,

the function is inside a table.

This code would make the rabbit jump under the ground or stop jumping mid-air until the for loop finishes

local WalkToCFrame = script.Parent.Body.CFrame * CFrame.new(math.random(-30,30),0,math.random(-30,30))
WalkToCFrame = CFrame.new(WalkToCFrame.X, 0, WalkToCFrame.Z)

What would the code you sent me do?

This line would set the Y position of the CFrame to 0.

Oh yes! thanks! It works, thanks.

You’re welcome! :smile:

abunchofcharacters

This question is completely off topic, but im new to the forum and how did u make the text blurry

I used this!

Okay thanks.

stop using white theme xd

You can also do

[spoiler]Text here[/spoiler]

I don’t really like the style of the dark theme lol

ok lol gotta make the rabbit move more smoothly xd

I suggest you use delta time. RunService:RenderStepped or RunService:Stepped should work