Version 4 (modified by edy, 12 years ago) (diff)

--

Tutorial: Basic scene

1. Create a new scene and prepare the scenery

  • File > New Scene
  • GameObject > Create Other > Plane
  • GameObject > Create Other > Directional light

Alternatively you can create a terrain or import a pre-created scenery.

  • Terrain > Create Terrain
  • Play a while with the terrain tools (height, texture...)
  • Leave flat areas for the roads, or you could use the Road and Path Tool (available at the Asset Store) for creating the roads.

3. Add the control prefabs to the scene

They are located at the folder EdyVehiclePhysics/Prefabs. Add them to the root of the hierarchy:

  • Main
  • MainCamera
  • SkidMarks
  • MapCamera (optional)

Important: The position and rotation of Main and SkidMarks must be (0,0,0). Scale must be (1,1,1). Otherwise the mirrors and the skidmarks won't be displayed correctly.

Also remove the Main Camera object that was included with the empty scene.

4. Add vehicles to the scene

The cars from the Live Demo are available at the folder Vehicles / Prefabs.

You have a prefab EmptyCar at the folder EdyVehiclePhysics / Prefabs. This car is fully functional, so you can just place the proper graphics.

5. Configure the scripts

  • Add each user-controlable vehicle to the list Main > CarMain script > Cars.
  • Main > CarMain script > MainCamera must point to the MainCamera game object.
  • MainCamera > CameraControl script > Mirror... references must point to the Mirror... game objects located as children of Main.
  • MainCamera > CameraControl script > MapCamera must point to the MapCamera gameobject (if added at step 3).

6. PLAY!

Now everything's ready and working!

7. Optional elements

You can add your post-processing image effects to the MainCamera object. If you place a reference to them at CameraControl script > ImageEffects then they will be enabled / disabled with F12 (low quality mode).

Same with the main directional light used to project shadows. Reference it at Main > CarMain script > MainLight so the shadows will be disabled in the low quaility mode (F12).

Payload: you can reference a rigidbody at CarMain script > Payload and it will be "lifted" when pressing E. This is an element just for fun in the Live Demo, a kind of heavy box that is originally loaded at the red pickup.