have object lean in the direction you are stood on it

Hi all, I want to create a platform you can stand on, and depending on where you are stood, the platform dips downwards. I do not want to use rigidbodies for this. The player becomes a child of the platform when they stand on it, so I tried making the transform rotation of the object increase based on the player’s transform position, but this didn’t work; the platform rotated when I stood on it and didn’t ever visibly rotate afterwards.

Any suggestions for this? Don’t need any specific code, just an idea to implement.

Hi! Using rigidbody isn’t the end of the world… just use a kinematic rigidbody and so you can have precise collision check and you can control all movements…

If you want to move down then use onCollisionEnter and transform.translate on each frame and onCollisionExit you can restore the original Y position smoothly…

for rotation just set a rotation velocity depending on how far from center the player is standing (remember to set a zone in center where it doesn’t rotate)… same as before, when collision stops the rotation returns to zero…

hope this helps