How would i make these parts "wobble"

I would like the parts to wobble in a way when the player moves back and fourth, like if I run forward I would like the parts to get pushed a little backwards (as if it were Jell-O)

I looked everywhere but couldn’t figure it out so if anyone would help that would be great

Each frame you should check the velocity of the bottom part. The part above it should slide th opposite way a little bit. This amount it slides is the velocity of that higher part, and then you can repeat going all the way up, the velocity will get smaller each time. You will probably have to put a limit on how far each plate is allowed to slide, so they don’t completely go over the edge, and you probably only want to count the XZ movement, not the vertical movement.

Could you give me an example? (Not asking for full script just an example)

You could have something like this:

--boxes is a table where [1] is the bottom box
--jerk is some vector2 sliding velocity calculated from the characters difference in position each frame

for i = 2, #boxes do
	local box = boxes[i]
	local lastBox = boxes[i - 1]
	--Slide this box relative to the last box's position scaled by the jerk
	box.CFrame = lastBox.CFrame + Vector3.yAxis * boxThickness + lastBox.CFrame * jerk

	--Reduce the jerk strength by half
	jerk *= 0.5
end
1 Like

Thanks for the help! But I was wonder what would Jerk look like?

You just choose it based on the character’s velocity. it should have no Y component since you don’t want the boxes just floating up and down.

1 Like

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