transform.position? (Javascript)

I’m watching a tutorial video and I’m not sure if it’s outdated or not, but I tried doing…

if(transform.position == -100) {
	transform.positiono.y = 3.4;
	transform.position.x = 8.8;
	transform.position.z = -2.2;
	}

And although I don’t get errors, it doesn’t work either.

What would be the correct way of resetting the players position if he falls off the map?

try this:

if(transform.position.y <= -100) {
transform.position.y = 3.4;
transform.position.x = 8.8;
transform.position.z = -2.2;
}

When you want to assign the position of an object you cant use float you need to use Vector3 and when you want to access a specific axis(y,x,z) is float, then, it is preferable to put <= than == because == is equals so you are asking for a specific number so if your player is falling to get the specific number is a little difficult and <= is less or equal to.. so this way would be better.

Also if you want you can put an empty respawn object and just create a variable:

var respawn : Transform;

then when he falls send the player to the empty object:

if(transform.position.y <= -100) {
transform.position = respawn.position;
}