- Home /
Question by
Ethanmogreg · Dec 11, 2020 at 12:57 PM ·
unity 5collision
Sphere (player) flattens/deforms when going on a moving platform.
I want the player to move onto a moving platform and move with the platform. I am making a marble game so the ball rotates, but I fear that's where the problem stems. When colliding with the platform's box collider, the sphere does this: (look at images)
Here's the code:
private void OnTriggerEnter(Collider other)
{
if(other.gameObject == Player)
{
other.transform.parent = transform;
}
}
private void OnTriggerExit(Collider other)
{
if (other.gameObject == Player)
{
other.transform.parent = null;
}
}
Please help!
Comment