Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

nightbird0

Simple Basic Car Control [C#]

Recommended Posts

Hi guys, here  is a simple script for car control which contains

 

Gears (5) No REAR Yet

Stop Lights

Start / Stop Engine

Fuel System [Fuel consumption in relation with RPM]

RPM

Editable controls

 

Simple attach the script into your can then attach the camera the sounds and the lights..

 

Please login or register to see this code.

 

 

 

  • Like 3

Share this post


Link to post
Share on other sites

Awesome. You have made a HUGE contribution to the forum and I thank you for that.

Share this post


Link to post
Share on other sites

not pro at all mate :P but thanks , it's more than basic , but i'm working with physics so i will make a new version more advanced :d

  • Like 1

Share this post


Link to post
Share on other sites
Please login or register to see this code.

you didn't assign the EngineStop clip or there is no audio source.. you didn't even write down the error code so i can't help you

Share this post


Link to post
Share on other sites

When i attach the script to my car, it gives an error

"Can't add component because it doesn't exist. Check to see if file name and class name match"

Any help?

Share this post


Link to post
Share on other sites
Please login or register to see this quote.

 

Have you made sure the name of your script matches the class name in the script? In this case it is Player

Please login or register to see this code. Edited by lcomstive
  • Like 1

Share this post


Link to post
Share on other sites

Please login or register to see this code.

      This is a Mistake  

isengine = false;

rpm = 0;

Debug.Log("Engine OFF");

AudioSource.PlayClipAtPoint(EngineStart, Car.position);

 

 The rest of the code works very well

 Thank you it's a good work :YMAPPLAUSE:

Edited by Mohsen
  • Like 1

Share this post


Link to post
Share on other sites

Thanks for such a wonderful code. I learnt a lot from this! I created a Simple multi-player racing code with it.  

  • Like 1

Share this post


Link to post
Share on other sites
Hi I thought I would use this script because it wasn't reliant on a camera as I want both FPS Camera and TP camera controls and the good news the enter vehicle script  works but the problem I have is that
1) It doesn't totally disable the vehicle
2) I have to make more cameras so that I can use a 1st /3rd person on the vehicle
 
I need help in disabling the vehicle ( which in my case is a hovertank) properly plus I want to have a fps and tp camera when I am driving the HoverTank
Show less
 
 
Please login or register to see this link.
 
 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×