Immerse

Camera Targets

Step 6 of 13 |20 mins

Spawn object

Navigation

Description

Immerse Platform users can join a scene using a VR headset or web browser (latest version of Google Chrome recommended). For browser participants, 3D content is rendered using WebGL .

When joining an Immerse Space in a browser, third person cameras can be used, which are activated by the space owner.

To set up cameras in a scene, a CameraTarget object is required for each of the required positions and angles. The SDK will automatically add a CameraTarget for each VR user, so browser users can see the scene through any VR users' 'eyes'.

Unless disabled, the master view will fly smoothly between different camera targets.

🚧

Only the Space owner can control the 'master view' for all browser participants; Individual participants cannot do this.

Adding a CameraTarget

  1. Ensure your Unity Scene has a standard Main Camera, which contains a standard Unity Camera component. Also ensure the Main Camera does not have an Audio Listener attached and that it is tagged with MainCamera

🚧

Only one camera in the scene can be tagged MainCamera

  1. Create a new object and use it as a root CameraTargets GameObject container to hold all CameraTargets in the Hierarchy.
  • Add a child GameObject.
  • Give the new object a name - this will also be the name of the clickable button in the browser view.
  • Set this GameObject's position and rotation appropriately.
  • Add the CameraTarget component.

Multiple CameraTargets set up in the corresponding Unity scene

Multiple CameraTarget objects can be added to a scene. Each of these targets will be represented by a button in the WebGL view.

Multiple CameraTargets shown in WebGL

📘

Immerse SDK Class Library

More details in CameraTarget class

Setting position and rotation

  1. Select the CameraTarget object in the Hierarchy view
  • Move Scene View so it represents the camera angle required
  • Select Game Object > Align With View from the main Unity Menu

When a CameraTarget is active, its position and rotation is applied to the main rendering camera. If a camera target is animated, the main camera will also animate.

To easily visualise a CameraTarget:

  • Select the CameraTarget object in the Hierarchy view
  • Select Game Object > Align View with selected
    The Scene View in the Unity Editor will move to the selected camera angle

Unity Editor component

PropertyDescription
Should Snap
By default, the master view will 'fly' smoothly between different camera views as they are enabled.

When Should Snap is enabled, camera views will jump immediately with no smoothing.
Update Smoothing SpeedThis controls how quickly the master view will move towards the camera view if snapping is not selected.
PriorityThis can be used to control the order the camera targets show in web view, the default selected camera target is the one with the highest priority.

📘

Immerse SDK Class Library

More detail available in ImmerseSDK.Camera class

Unity iconThe Demo Scene contains multiple examples of Camera Targets

Assets > Examples > Scene > DemoMaster.unity

Spawn object

Navigation

Updated 3 months ago


Related pages

Navigation

Camera Targets


Step 6 of 13 |20 mins

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.