User Custom Solution

This topic about how to replace the player with a custom user solution.

Player Character

If you want your own script to spawn player character, follow these steps:

  1. Set the World simulation type to Hybrid mono in the General settings config.

  2. Set the Player controller type to Custom in the General settings config.

  3. Disable built-in camera on the scene (this step is irrelevant if you are using the Hub Base instead of the Hub).

    _images/CityCreation4.png
  4. Make sure your camera has a cull point object as a child (set local position to zero).

  5. Add the HybridEntityRuntimeAuthoring component to your prefab.

  6. Add Copy Transform From Game Object, Player Npc components in the Hybrid components list.

    _images/PlayerNpcHybridAuthoring.png
  7. If you haven’t created your own scene yet, you can try the Demo Mono scene for tests.

  8. Custom player only works with Hybrid Mono vehicles.

  9. Your player prefab character is ready.

Player Car

If you want your own script to spawn player car, follow these steps:

  1. Set the World simulation type to Hybrid mono in the General settings config.

  2. Set the Player controller type to Custom in the General settings config (this step is irrelevant if you are using the Hub Base instead of the Hub).

  3. Disable built-in camera on the scene (this step is irrelevant if you are using the Hub Base instead of the Hub).

    _images/CityCreation4.png
  4. Make sure your camera has a cull point object as a child (set local position to zero).

  5. Make sure that you created & selected Hybrid mono traffic.

  6. Add the HybridEntityRuntimeAuthoring component to your prefab.

  7. Add Copy Transform From Game Object, Custom Raycast Target , PlayerCar components in the Hybrid components list.

    _images/PlayerCarHybridMono.png
  8. Add the Bounds runtime authoring & Velocity runtime authoring components to your prefab. (optional step)

    _images/PlayerCarBounds.png

    Bounds component example.

    _images/PlayerCarVelocity.png

    Velocity component example.

  9. Make sure that the traffic Raycast config includes a player car layer.

  10. If you haven’t created your own scene yet, you can try the Demo Mono scene for tests.

  11. Custom player car only works with Hybrid Mono vehicles.

  12. Your player prefab car is ready.