# creating race game

hi,

im new in using unity so i dunno how to make a racing game ... so my question is how can i create starting point in my terrain?

If you're new then looking through fully fledged tutorials might be more useful to you. http://unity3d.com/support/resources/tutorials/car-tutorial Is specifically about how to set up a controllable car, how handy! and there are other tutorials there as well for other basic concepts.

But to answer your question; when you add a GameObject in Unity you can set its transform position in the inspector window, This is its position.

Or you could drag it around in the scene view.

If you just leave it like this it will start at the position you leave it in the scene view, but you can also set the car's position using scripting. In a script attached to the car you can use the `Start()` or `Awake()` function, which are only called once each, to set a starting position, like this.

void Start()
{
transform.position.x = 5.0f;
transform.position.y = 10.0f;
transform.position.z = 30.6f;
}

or this

void Start()
{
transform.position = new Vector3(5.0f, 10.0f, 30.6f)
}

Just go through this link you will easily understand the mechanism for developing Car Race.

http://unity3d.com/support/resources/tutorials/car-tutorial

Use a box collider set to trigger so that when cars pass through it you know they've reached that check point.

e.g.

function OnTriggerEnter(other : Collider){
if(other.CompareTag("Car")){
other.gameObject.SendMessage("CheckPoint",1);
}
}

On the car:

function CheckPoint(number : int){
currentCheckPoint = number;
}

Then it's a simple case of making a string of check points from start to finish and checking that every car has passed through them all.

If you wanted to instantiate a set of cars at the start can just create an array of start points on the starting grid.