Navigate terrain maps with “drivable” vehicles through basic keyboard or gamepad input. Cycle multiple camera angles in and around the vehicle for observation of variables in the environment that affect physics of the vehicles, such as the suspension’s handling over “bump” objects. An overlay displays vehicle motion statistics in real-time.
Vehicle navigation controls vary by input device:
Switch camera angles by pressing the C key. Note, when at first-person view in the driver position, use mouse-look to change the camera orientation.
Exit and enter the vehicle by toggling the T key.
Enable the handbrake by holding the Space bar.
Pause the game by toggling the P key.
Note, the R key will call a function that attempts to reload the scene. This currently fails in the example scene.
The corner overlay displays the following values:
Utilize vehicle controls and first-person camera API for your scene by adding the following prefabs, which their respective scripts:
Note, the VehicleInputControllerPrefab contains the humvee model from Bravemind. Reference setup of this prefab when adding your own vehicle model to a custom prefab. Add the following script to the root of your prefab to enable vehicle control:
The example scene contains an OWT terrain map, collision mesh, and start point, represented by objects TerrainLoader, RazishNavmesh and TerrainCenter.
Note, the Scenario object is for testing purposes only, and belongs to the MSVehicleSystem(FreeVersion) 3rd party package.
First, add the Control prefab to your scene and in the Vehicles > Element 0 field, add your vehicle prefab. Next, in the Player field, add the MSFPSController prefab once instanced in your scene.
This prefab also contains the necessary Canvas child prefab.
Next, import the MSFPSController prefab into your scene for first-person controls of your avatar by way of the MSFPSController script. This prefab also contains the necessary Camera and Canvas child prefabs.
Remember to add this vehicle prefab in the Vehicles > Element 0 field of the Control prefab instanced in your scene.
Next, import the VehHmvM111402Prefab prefab into your scene as the vehicle to be controlled by way of the MSVehicleControllerFree script.
This “game-ready” prefab contains all the necessary objects, including model, cameras, colliders, etc.