Moving character over a rotating platform.

So I have been pretty stuck on how to achieve this effect as in fall guys.

The platform rotates.
The character rotates with the platform but can move over it and jump also.

Do I make both of them rigidbodies or not?
Currently my character stays stuck at one position or moves very slowly as compared to rotation of the platform.

How about a new Script called “RotatingPlattform” which have an event,
whenever any GameObject steps on it, it turns with the Plattform itself

Try making the player transform a child of said moving object.

Not sure if this is what your looking for. When player falls on the rotating platform with the nametag platform
it moves with it.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ThePlayer : MonoBehaviour
{


    private void OnCollisionEnter(Collision collision)
    {
        if (collision.gameObject.CompareTag("Platform"))
        {

            this.transform.parent = collision.transform;

        }
     
    }
    private void OnCollisionExit(Collision collision)
    {
        if (collision.gameObject.CompareTag("Platform"))
            this.transform.parent = null;
    }
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class rotateplatform : MonoBehaviour
{
    public float rotatingSpeed = 10f;


    // Start is called before the first frame update
    void Start()
    {
       
    }

    // Update is called once per frame
    void Update()
    {
        transform.Rotate(Vector3.up, rotatingSpeed * Time.deltaTime);
       
    }
}

Ignore this if you already managed to solve the problem, but I was just looking for the same until I remembered the LEGO Microgame implements that mechanic, so I used their MinifigController script as a guide and was able to successfully reproduce what you intend.

Basically you need 2 methods on the script that controls your character:

  • OnControllerColliderHit (assuming you are using a CharacterController): here you’ll perform a ShpereCast, when the player is grounded, to get the collider that’s underneath them and store it’s transform inside a variable.
  • Update: before applying any movement and rotation, you need to calculate and add the values for external motion and rotation based on the previously stored transform.

I confess I would never be able to achieve this by my own means, but it’s really not hard to figure it out if you use the mentioned script as a guide. So, install the LEGO Microgame and check it out.