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
0
Question by Doctor · Apr 25, 2012 at 02:50 PM · carcarscar-tutorial

Car NOS Boost

I'm doing a racing game and i was wondering if anyone knew how i could do a speed boost. I'm fairly new to Unity so i don't really know what i'm doing.

I'm building this upon the car tutorial so that I don't have to rebuild the terrain or the car.

Comment
Add comment
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

3 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by TSorbera · Apr 26, 2012 at 02:49 PM

I'll be giving you general help to help you learn, rather than looking up this tutorial and telling you the exact code.

Find the code that makes the car go when you press the accelerator button. Somewhere it will define how fast the car goes. Add a condition that if the boost is active, probably triggered by a Button press, the speed or acceleration rate of the car should be higher.

Comment
Add comment · Show 3 · 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 Doctor · Apr 30, 2012 at 01:31 PM 0
Share

I added the following code: var SpeedBoost : float 900; and function GetButtonDown (LeftShift) { update topSpeed : float SpeedBoost; }

But when I go to try and test this code, I get an error saying that it was expecting a semicolon after "update topSpeed : float SpeedBoost". I've tried various other ways but haven't been able to get rid of this error.

avatar image Kiloblargh · Apr 30, 2012 at 06:53 PM 0
Share

um... "=" ?

avatar image Doctor · May 01, 2012 at 01:04 PM 0
Share

I still have the error saying "Assets/Scripts/JavaScripts/Car.js(74,15): UCE0001:';' expected. Insert a semicolon at the end. The line of code that is creating this error is: " function GetButtonDown (LeftShift) { update topSpeed = float SpeedBoost; } "

avatar image
0

Answer by AusAndrew19 · Aug 22, 2013 at 02:30 PM

Sorry For Grave Digging. But i thought i would answer this so other people could see it aswell.. This isn't the best way to do "NOS" But it works :)

 #pragma strict
 var isReady : boolean = true;
 var activateSound : AudioClip;
 var vehicle : GameObject;
 var waitTime : float;
 
 function Start () {
 
 }
 
 function Update () {
     if(Input.GetKeyDown("left shift") && isReady){
         Nitrous();
     }
 }
 
 function Nitrous () {
     audio.PlayOneShot(activateSound, 1);
     isReady = false;
     vehicle.rigidbody.AddForce(transform.forward * 1000, ForceMode.Acceleration);
     yield WaitForSeconds(waitTime);
     isReady = true;
     
 }
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 arwe2793 · Apr 18, 2014 at 07:00 PM

you could try this http://www.youtube.com/watch?v=oZWCg9pM7Bc&list=UUJNI1KRjHTRY66qThiKSU5Q its free with nitro effect

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

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

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

How can i rotate my car steering wheel in accordance to the wheels? 1 Answer

TOP down 2d car physics 0 Answers

stabilize car? help! 0 Answers

Switching from player to car 2 Answers


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