How to create a seesaw?

Hey, i am trying to create a seesaw with a the physic engine, i tried to use torque to achieve it, but without any success because when the player touch the platform the platform just flies away

Any suggestions?

You need to fix it in place with say a revolute physics joint. You can enable angle limit as well. This would add a joint in the center of an object and allow it to rototate between -20 an 20

You can use the center X and Y because that’s the point where the object rotates around.

Thanks for your help @Keith_1357 , i tried it and works, but it doesn’t works properly as you can see

If they’re both physics objects the weight of the player should rotate the seesaw. You may need play to with some settings. Or give it some help.

Also, you need to use the physics collision condition when using physics. The normal collision condition doesn’t work consistently because it’s the physics job to keep the objects from colliding. So, it doesn’t always trigger the basic condition. Especially if the default hitbox and the physics behavior hitbox are different.

Edit : torque is a force. Applying a force of 0 does nothing.

I’m not sure what you’re doing. Do you want it to be one way or is it something to interact with?

no, the character has no physics, only the platform. what I would like to have is a seesaw that rotates based on the player’s position and if the player is not on the seesaw it returns to the basic state

I’ve only played around a little with a physics seesaw. I once played with attaching balloons on strings to lift a floating platform.

I wouldn’t mix the platform with physics. They conflict. You could rotate the platform. Setting it’s angle based on distance from the center or increase the angle when the player is on 1 side. And decrease it when on the other. Using limits and different rates depending on the distance from center. Without collision or not on platform condition, the board could slowly reset itself.

Since I’ve never played with a platform based seesaw. I don’t have much else to say. If I’m at my PC I might play with the concept.

I tried something like that :
Change angle = DistanceBetweenPositions(Player.CenterX(), Player.CenterY(), SeesawPlatform.CenterX(), SeesawPlatform.CenterY())

But the results are really bad

I didn’t have sucess either. I don’t think the platfrom works rotated. I guess you’d have to switch between platform and physics. But then you’d have to add controls for the physics. I’m out of ideas.

Mine worked when walking except it floated. It didn’t work with jumpling. I thought by rotating the player to match the platform it might work but I guess it uses the bounding or something.


It looked better rotated but the jumping doesn’t work.

This was my attempt. I used a ray cast to detect the seesaw.

Maybe someone else has a better idea.

Actually is pretty good, but there is thia bug where the Player just go crazy if fall on the platform

1 Like