Character not detecting collision with a platform, despite the platform impeding fall

Hello, Ive been trying for two days to get my character to take on a platform as a parent(in order to move with it) but as I discovered today when trying to Debug to solve the problem, that the Collision isn’t being detected at all, here is my code:

private void  OnCollisionEnter(Collision c)
	{
		if(c.transform.name == "Platy")
		{
			transform.parent = c.transform;
			Debug.Log("YOURE DOIN IT!");
		}
	}

	private void OnCollisionExit(Collision c)
	{
		if(c.transform.name == "Platy")
		{
			transform.parent = null;
		}
	}

The player has a CharacterController component and the platform has a box collider, anyone have any suggestions/ideas?

My suggestion would be to always read docs.unity3d.com/Documentation, there you can read about the OnCollisionEnter and see: Note that collision events are only sent if one of the colliders also has a non-kinematic rigidbody attached.

Does the platform or the player contain a rigidbody?

“Platy” is tag name?

Use this code friend:

void OnCollisionEnter(Collision coll) {

	if (coll.gameObject.tag == "Platy"){
		
		
	}
	
	
  }

      ////////////////

But do not forget to put the title tag, the GameObject that contains the component collision. Ok?