//imaginary variables
public Transform previousParent;
public GameObject ship;
public GameObject player;
bool isNearWheel;
private void Update()
{
if (Input.GetKey(KeyCode.F) && isNearWheel)
player.transform.SetParent(ship.transform);
}
private void OnTriggerStay(Collider other)
{
if (other.tag == "wheel")
isNearWheel = true;
else isNearWheel = false;
}