When you don’t see the message “Saved respawn position” in the console, you never get into that if statement, so you never assign any value to “platformTransform” and it will stay at the defaul value which is (0, 0, 0). Rethink about your condition and if you’re not sure why the statement is never true, test each part seperately:
if (transform.position.x < platformTrackerPoint.transform.position.x)
{
Debug.Log("x-position smaller than tracker point");
}
if (thePlayerMovement.grounded)
{
Debug.Log("player is grounded");
}
Also make sure you don’t get any errors like a NullReferenceException which would break everything. Make sure all your references are setup properly. In your case you have 3 variables that should be checked: