Skip to content

deathwatchgaming/Unity-UnityCar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unity-UnityCar

This originally was just some very minor edits to the existing CarControl.cs script in: Unity 6 docs - "Car with wheel colliders tutorial" simply for things like adding pub struct to list so as to combine the CarControl and Wheels files into one just for example and then to provide scripts variants for both old and new input and provide variants of such for Unity 6 and also 2021-22 and that remains the original intent with so far only few further changes added further over time for example now expanding slightly by adding further braking functionalities and two optional camera scripts, etc...

Original Unity Tutorial: "Create a car with Wheel colliders": https://docs.unity3d.com/6000.0/Documentation/Manual/WheelColliderTutorial.html

Note: (This repository directory here as noted above in the description was originally just merely some files from such tutorial mildly edited, though now has expanded slightly by adding further braking functionalities and two optional camera scripts)

Preview

Preview

Preview

Preview

Preview

Optional Camera scripts:

CarCamera.cs:

Preview

CarCameraPlus.cs:

Preview

Preview

Car Controls:

  • Car Forward: W
  • Car Reverse: S
  • Car Turn Left: A
  • Car Turn Right: D
  • Car Brake: Space

New Input System Variant(s) Setup Instructions:

Car Setup:

This car control script is responsible for controlling the car's movement, steering, and braking using the new Unity Input System. It handles the physics of the car through WheelColliders and updates the visual representation of the wheels accordingly.

Car Camera Setup:

Car Camera: (optional usage - this or the other or none is up to you)

This camera script is responsible for controlling the camera that follows the car. It uses the car's velocity to determine the camera's rotation and position. The camera will smoothly follow the car and rotate to match the car's velocity vector. If the car is not moving, the camera will default to looking forward.

Car Camera Plus: (optional usage - this or the other or none is up to you)

This camera script provides a dual-mode camera (Follow + Orbit) with robust anti-clipping, mode transition safety, and full support for both cursor locked and unlocked states.

Old Input System Variant(s) Setup Instructions:

Car Setup:

This car control script is responsible for controlling the car's movement, steering, and braking using the Unity "Legacy" Old Input System. It handles the physics of the car through WheelColliders and updates the visual representation of the wheels accordingly.

Car Camera Setup:

Car Camera: (optional usage - this or the other or none is up to you)

This camera script is responsible for controlling the camera that follows the car. It uses the car's velocity to determine the camera's rotation and position. The camera will smoothly follow the car and rotate to match the car's velocity vector. If the car is not moving, the camera will default to looking forward.

Car Camera Plus: (optional usage - this or the other or none is up to you)

This camera script provides a dual-mode camera (Follow + Orbit) with robust anti-clipping, mode transition safety, and full support for both cursor locked and unlocked states.

About

Just some minor edits to the existing CarControl script in: Unity 6 docs - "Car with wheel colliders tutorial" simply for things like adding pub struct to list so as to combine CarControl & Wheels files into one as well as some further edits expanding braking functionalities and adding two optional camera scripts, etc...

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages