Trailers
Both truck and trailer in NVP2 use the same VehicleController script. Therefore, they should both be configured as a normal vehicle. Check Quick Start Guide for more info on vehicle setup.
- Towing vehicle needs to have TrailerHitchModule attached.
 - Trailer vehicle needs to have TrailerModule attached.
 
Click on the names of individual modules for more info.
Tips
- Since the trailer does not need all the vehicle components enabled as a full vehicle it is a good idea to use a separate
State Settingsfor the towing vehicle and the trailer. ExampleTrailerStateSettingsare included. - Due to the input mirroring between the towing vehicle and the trailer it is possible to use blinkers, effects, sounds, etc. on the trailer. It is even possible to make trailer powered by enabling
Powertrainin trailer's state settings. 
Attaching Trailer
- Trailer is attached by driving the vehicle so that the attachment points of both vehicles are close and pressing the TrailerAttachDetach (“T” by default) button.
 - Trailer attachment points work based on triggers. This is a SphereCollider whose radius can be set through the
TrailerModuleandTrailerHitchModuleinspectors. 
Modules
Trailer Hitch Module
VehicleController with TrailerHitchModule can attach a VehicleController with TrailerModule as a trailer.
- Both
TrailerHitchModuleandTrailerModulecan be present on one vehicle at the same time. AttachmentPointis the point at which the trailer will be attached. The trailer will be moved so that both trailer and hitchAttachmentPoints are at the same position. This is where the physics joint gets created.Attachment Pointneeds to be a child of theGameObjectcontaining theTrailerHitchModule.- On initialization a SphereCollider trigger is created at the attachment point. This is used to detect if a TrailerModule is nearby. When there is overlap between the
TrailerModuleandTrailerHitchModuletriggers, pressing 'T' (default key mapping) will connect the trailer. 
Also check Trailer module.
Trailer Module
TrailerModule works in tandem with TrailerHitchModule. VehicleController that has TrailerModule is able attach to a VehicleController that has TrailerHitchModule.
- One vehicle can have both
TrailerHitchModuleandTrailerModule. Attachment Pointis the point at which the trailer will be attached to the towing vehicle. The script creates a SphereCollider trigger at this point which detects if the TrailerHitchModuleAttachment Pointis nearby.Attachment Pointneeds to be a child of theGameObjectcontaining theTrailerModule.Trailer Standis the object which will be enabled if the trailer is detached and vice versa. It prevents the trailer from tipping forward on trailers with only the back axle.- If
Synchronize Gear Shiftsis enabled the trailer object will be kept in the same gear. This allows for powered trailer or vehicles that are constructed out of two Rigidbodies. 
Also check Trailer Hitch module.


