Having a player model move with a rotating platform.

I’m in the process of making a level for a college course. The level is set in a theme park and uses a ferris wheel.

In order to make the platforms on the ferris wheel remain level during rotation, I have them rotating in the opposite direction of the wheel rotation. It works very well, until the player steps on it.

I’m currently using the parenting script here:

void OnTriggerStay(Collider other)
{
if (other.tag == “Player”)// Moves Player with platform
{
other.transform.parent = transform;
}

else if (other.tag == “Phys”)// Moves objects with platform
{
if (other.GetComponent() == null)
{
other.transform.parent = transform;
}
}
}
void OnTriggerExit(Collider other)
{
if (other.tag == “Player”)// Stops movement when player leaves platform
{
other.transform.parent = null;
}
else if (other.tag == “Phys”)// Stops movement when object leaves platform
{
if (other.GetComponent() == null)
{
other.transform.parent = null;
}
}
}

This causes the player model to spaz out when used. Does anyone have any alternatives they could suggest?

USE CODE TAGS!

Next suggestion… don’t compare (==) with tag, instead call ‘CompareTag’, it’s more efficient.