When I jump into the moving platform they show my this error.
void OnCollisionEnter2D(Collision2D other)
{
if (other.transform.tag == "MovingPlatform")
{
transform.parent = other.transform;
}
}
void OnCollisionExit2D(Collision2D other)
{
if (other.transform.tag == "MovingPlatform")
{
transform.parent = null;
}
}
The error is this line of code:
transform.parent = null;