wiki.sine.space | sinespace

Difference between revisions of "Vehicles"

From wiki.sine.space
Jump to: navigation, search
Line 1: Line 1:
'''Please notice there are two version of script for Vehicles: the old ones are the scripts like "car physics", "car vehicle", which are obsolete; the new vesion is one script called "Modular Vehicle", it combines all kind of vehicle together(land, hover, boats) so you can adjust this one script for all vehicle settings. The new version resolved many bugs of the old version, so we recommanded to use the new one.''' We will still keep the tutorial of old version in other pages, you can always check them if you need.
+
'''Please notice there are two versions of script for Vehicles: the old ones are the scripts like "car physics", "car vehicle", which are obsolete; the new vesion is one script called "Modular Vehicle", it combines all kind of vehicle together(land, hover, boats) so you can adjust this one script for all vehicle settings. The new version resolved many bugs of the old version, so we recommanded to use the new one.''' We will still keep the tutorial of old version in other pages, you can always check them if you need.
  
  
Line 39: Line 39:
 
There are four types of vehicles in the Space virtual world platform;
 
There are four types of vehicles in the Space virtual world platform;
  
==Land==
+
==Tutorial for obsolete vehicle script==
 
+
[https://wiki.sine.space/index.php?title=Vehicles/Land Land vehicles]
'''Collider'''
+
[https://wiki.sine.space/index.php?title=Vehicles/Air Aircraft and Gliders]
 
+
[https://wiki.sine.space/index.php?title=Vehicles/Hover Hover Vehicles]
Select the main mesh for your vehicle and add a collider.
+
[https://wiki.sine.space/index.php?title=Vehicles/Water Watercraft and Boats]
 
+
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.
+
 
+
 
+
[[File: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.  
+
 
+
 
+
[[File: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'''
+
 
+
 
+
[[File: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'''
+
 
+
 
+
[[File:Vehicle_rigid_body.jpg]]
+
 
+
 
+
PENDING
+
 
+
 
+
'''Car Physics'''
+
 
+
 
+
[[File: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
+
  
 
{{Creation Navbox}}
 
{{Creation Navbox}}

Revision as of 04:58, 19 November 2018

Please notice there are two versions of script for Vehicles: the old ones are the scripts like "car physics", "car vehicle", which are obsolete; the new vesion is one script called "Modular Vehicle", it combines all kind of vehicle together(land, hover, boats) so you can adjust this one script for all vehicle settings. The new version resolved many bugs of the old version, so we recommanded to use the new one. We will still keep the tutorial of old version in other pages, you can always check them if you need.


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;

Tutorial for obsolete vehicle script

Land vehicles Aircraft and Gliders Hover Vehicles Watercraft and Boats