I am making a car driving game and I was wondering if how I would open a new level once the computer saw that the car was in a certain x, y, and z position? Preferably in c#
I would place a collider at the said position, once the car collides it, have your statemanager load the next scene/level. This should be fairly trivial to code.
How about making a simple distance check from your map(level)origin to your car?
For example if your car have only 20% distance left to your map border then load the next level or map resources. Log your distance results and read the distance on this specific location… or reading out the map (MeshRenderer)bounds (size) for maxDistance clamp.
// replace the mMapBounds with any other centered Vector3
float distance = Vector3.Distance(mCar.transform.position, mMapBounds.center);
if(distance > z) // z can be a calculated value or set a fixed one
{
Debug.Log(string.Format("Car reached map border threshold. Distance: {0}", distance));
//Resources.Load("");
}