Trailer Hitch Module
VehicleController
with TrailerHitchModule
can attach a VehicleController
with TrailerModule
as a trailer.
- Both
TrailerHitchModule
andTrailerModule
can be present on one vehicle at the same time. AttachmentPoint
is the point at which the trailer will be attached. The trailer will be moved so that both trailer and hitchAttachmentPoint
s are at the same position. This is where the physics joint gets created.Attachment Point
needs to be a child of theGameObject
containing 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
TrailerModule
andTrailerHitchModule
triggers, pressing 'T' (default key mapping) will connect the trailer.
Also check Trailer module.