Mover Player With seesaw

hi

i am fasing problem kindly give me an idea…

problem is i have to move player with seesaw… when seesaw moves if player is standing on seesaw that should also move with seesaw…

seesaw is moving with this scripts attached with seesaw…

void OnMouseDown()
{
    screenPoint = Camera.main.WorldToScreenPoint(gameObject.transform.position);
 
    offset = gameObject.transform.position - Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, screenPoint.z));
 
}
 
void OnMouseDrag()
	{
	    Vector3 curScreenPoint = new Vector3(Input.mousePosition.x, screenPoint.y, screenPoint.z);
	 
	Vector3 curPosition = Camera.main.ScreenToWorldPoint(curScreenPoint) ;
	transform.position = curPosition;
	 
	}

kindly give me your idea how player will move with seesaw…

Thanks

hi,

you can change the player’s parent to be the seesaw whilst the player is on it…
see the below example:

playerTransform.parent = colliderGameObject.transform;