The avatar recording feature allows the movement of a user's head and controllers to be stored to a local file. This file can be played back and will act like a real user in a scene.
When an avatar is recorded, the following information captured:
- Some recording meta data, such as timestamp, headset model information, platform, etc.
- The position and rotation of the head over the time period of the recording
- The position and rotation of both controllers over the time period of the recording
- Any controller input (buttons pressed, etc) over the time period of the recording
When avatar recording has finished, the data will be saved as a binary stream, which can be used at runtime for playback.
We support playback in the following scenarios:
- At runtime on a simulated user (see Debugging multi-user scenarios)
- At runtime by converting the local user to a Scripted Avatar. In this scenario, the local VR user is converted to a Scripted Avatar (VR hardware disabled) and allows for movement to be controlled via scripting. You can see more in our example called
This method is also used in our Playmode tests, and you can also write your own. You will need to use our Playmode test framework since we need to ensure our internal systems are initialised correctly. This is built on top of Unity's Testing Framework.
- Open the Unity Editor and load project.
- Open the Immerse Project Window by selecting Immerse > Window > Immerse Project
- Ensure Hold Point to Record is checked. This makes it easier to start a recording without having to remove the headset.
- Also check Offline in Editor. Note you can also record in Online mode or in published builds. This step just makes it simpler for the purposes of the example here.
- Enter Playmode by pressing the Play button the the Unity Editor
- Put on VR headset
- Position yourself where you want to start the recording.
- Press and hold the 'Point' button on the VR controller. It will vibrate when recording starts.
- Perform the required actions
- When complete, press and hold the 'Point' button until the controller vibrates. The recording will be saved to disk, with the console log line output detailing the recording's location. An Explorer window containing the recording should also open.
- Rename or move the recording if required, but ensure it is in a Resources folder, as this is how it will be loaded at runtime.
- Take off headset and exit Play mode.
You need to perform a few coding tasks, which is better explained in an example with actual code. See
Try out this component in the Examples project
Examples (menu) > Features > Load Avatar Recording Playback Example
Updated 9 months ago