Vehicles

From sine.space Wiki
Jump to: navigation, search

Quick and dirty update for the ModularVehicleComponent: Red Truck

Truck model from asset store, consists of empty gameobject with five dependent meshes; the truck body proper and four wheels.
all else you will see on the vehicle is added during the 'scripting' process.
Redtruck.png
This is not a perfect vehicle. It's 'alright'. There is more that could be done with it, which Adam covers in the related Artist's Masterclass. It is, however a decent reference vehicle, for making vehicles that behave in a more or less expected fashion, vis a vis real life (tm) vehicles.


NOTE:
As it turns out, on 'realistic' terrain, this truck drives a bit like a moon buggy. For a more realistic experience, set 'Max Speed' to '15'; 'Mass' to '7500' and adjust the rear wheels such that each has 'Forward Torque' to '750' and 'Backward Torque' to '500'. On the wheel colliders (all four wheels), set 'Suspension Spring' to '6' and 'Damper' to '10'.



This is the basic modular vehicle component for the red truck. There's a few more bits to it off the bottom, but they do not apply to this vehicle.
Redtruckmodularvehiclecomponent.png

These are the 'core forces' settings. They configure the vehicle 'overall'. Everything else is pretty much 'per wheel'. Note that the first two wheels are right and left rear.
Redtruckmodvehcompcoreforces.png

This is a representative rear wheel. The other rear wheel looks identical, it's just on the other side.
Redtruckrearwheel.png

This is a representative front wheel. As with the rear wheels, the other is identical.
Redtruckfrontwheel.png

This is the collider for the rear wheel. It will be the same on the other side. Differences are in the name and position on the model. This applies generally to all the wheel elements.
Redtruckrearwheelcollider.png

This is the collider for the front wheel.
Redtruckfrontwheelcollider.png

Finally there's a trail rendering component for making tracks
Redtruckrearwheeltrailrenderer.png


There are four types of vehicles in the Space virtual world platform;

Land

Collider

Select the main mesh for your vehicle and add a collider.

Ensure the collider does not overlap with the wheels.

The wheels will have their own colliders applied by the Car Physics script and those colliders should not overlap the body collider.


Box collider.jpg


You can adjust the collider size manually by clicking the Edit Collider button and grabbing the small green dot in the middle of each surface, or by entering size and position parameters in the Inspector.


Box collider settings.jpg


Car Vehicle Script

Attach the Car Vehicle component to your vehicle.

This will add three scripts to the object;

Car Physics


Car physics.jpg


Mouse Control

Control Locked

Min Speed

Check for active

Wheel FR / FL / BR / BL

Suspension distance

Springs

Dampers

Wheel radius

Torque

Brake Torque

Wheel weight


Vehicle Rigid Body


Vehicle rigid body.jpg


PENDING


Car Physics


Car vehicle script.jpg


Add the animation track from an FBX file here to apply a pose to the user's avatar while using the vehicle.

Air

PENDING

Water

PENDING

Hover

PENDING