Wheel Collider

Wheel Collider

library
⭐ 9 favorites
👍 4 upvotes
👎 4 downvotes

Organization

Name: Facepunch
About: Facepunch is a British video game developer and publisher headquartered in Birmingham, England, founded in June 2004
Website: Visit
Twitter: @sboxgame
Discord: Join

Description

Wheel Collider

Collider for ground vehicles, with built-in collision detection, basic suspension physics, and a basic tire friction model.

Usage

Create a car GameObject with a Rigidbody component, a collider, and a model. Create four empty child GameObjects with just models. These shouldn't have colliders or be rigidbodies.  Attach a Component script that controls the car on the car GameObject, for example:

public sealed class Car : Component { [RequireComponent] public Rigidbody Rigidbody { get; set; } private List<Wheel> Wheels; protected override void OnEnabled() { Wheels = Components.GetAll<Wheel>( FindMode.EverythingInSelfAndDescendants ).ToList(); } protected override void OnFixedUpdate() { float verticalInput = Input.AnalogMove.x; float torque = verticalInput * 10000f; // Apply torque to each drive wheel foreach ( Wheel wheel in Wheels ) { wheel.ApplyMotorTorque( torque ); } } }

Screenshots

Wheel Collider - Thumbnail 1
No usage statistics available
This package may be new or not widely used yet. Usage data becomes available as more users install and play with the package.
1.5/5
Average Rating
2
Total Reviews
1★
1 reviews
2★
1 reviews
3★
0 reviews
4★
0 reviews
5★
0 reviews
Package ID: facepunch.libwheel
Created: 2024-07-11 15:17 UTC
Updated: 2024-08-10 13:01 UTC
Type: library
Public: Yes
Version: 65296
Files: 6
Size: 0.0 MB
Engine Version: 17
Asset Version ID: 65296
Version Created: 2024-08-10 13:01 UTC
Hash: -3350595593643487300
Manifest: Open manifest
Changes: Changes on 2024-08-10
Cs Proj Name:
Compiler: Sandbox, SANDBOX;ADDON;DEBUG, 1701;1702;1591;, 1, , 1, Array, Array, Array
Resources:
Code Package References:
#65296 Aug 10, 2024
Changes on 2024-08-10
📁 6 files 💾 8.4 KB 🔧 Engine v17
#60338 Jul 15, 2024
Changes on 2024-07-15
📁 6 files 💾 7.93 KB 🔧 Engine v17
#60335 Jul 15, 2024
Changes on 2024-07-15
📁 6 files 💾 8 KB 🔧 Engine v17
#60135 Jul 11, 2024
Changes on 2024-07-11
📁 6 files 💾 7.95 KB 🔧 Engine v17
#60133 Jul 11, 2024
Initial
📁 6 files 💾 7.85 KB 🔧 Engine v17