Player slips through platform even if he is parented

this is the script of my detection if my player is on the platform

function OnTriggerEnter(other:Collider){

       if(other.gameObject.tag == "platform"){
       transform.parent = other.transform;

   }
}

function OnTriggerExit(other:Collider){

if(other.gameObject.tag == "platform"){
     other.transform.parent = null;

   }
}  

i can see that my player is the child of the platform, but he just slips through the platform. ive added a character controller to my character and i ve checked the trigger box in the box collider.

Try it without the trigger being set. Make sure one of the objects has a rigid body attached (probably set to isKinematic = true).

A trigger doesn’t cause collisions in the physics engine.
Remove the trigger option on your collider on your platform, and use OnCollisionEnter.

If your platform is a plane, rather change it to a cube. Most physics engines have problems with plane collisions.

Also parenting a rigidbody with gravity to another object will not necessarily stop that object from falling away from the parent, depending on what the parent is and how it’s been setup.

I think this line (and the corresponding ontriggerexit line) is wrong.

if(other.gameObject.tag == “platform”)

Should be

if(other.gameObject.tag == “Player”)