Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
-2
Question by bachan · Jul 27, 2010 at 08:14 AM · javascriptterrainracespawnpoint

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?

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image qJake · Jul 27, 2010 at 08:24 AM 0
Share

Don't ask broad questions here. Ask specific ones ins$$anonymous$$d, like "How do I create terrain?" or "How do I create a spawnpoint?".

avatar image Mike 3 · Jul 27, 2010 at 09:16 AM 1
Share

His question does seem to be "How do I create a spawnpoint"?

3 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by sovalopivia · Jul 27, 2010 at 10:32 AM

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.

alt text

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)
}
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by karthik · Jul 27, 2010 at 10:56 AM

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

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

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by spinaljack · Jul 27, 2010 at 09:49 AM

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.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Moomooz · Jul 20, 2012 at 06:26 PM 0
Share

Can you tell me where to add these two scripts to the Unity Car Tutorial please ,I added them but nothing seems to happen :(

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

Diamond Square Algorithm 2 Answers

Make a simple tree 1 Answer

How would I flip or mirror Terrain data during runtime? 1 Answer

Making changes to a terrian in game 1 Answer

Tracking information across terrain 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges