As we successfully created our first Unity project targeting Quest 2 device in the previous post, now we will get insight into one of the most powerful set of capabilities provided by Meta via Presence Platform.
The Presence Platform is designed to create a sense of shared presence and interaction in virtual reality environments. It enables people to connect, interact, engage with each other in immersive virtual spaces using VR headsets.
Features and capabilities of Meta's Presence Platform include:
As you can see Presence Platform is comprehensive set of sub-system/features, and I will cover each of them in detail, but to get started - let’s start from hand tracking as one of the basic requirements for VR game development - we will setup, build and launch hand tracking game like experience.
A perfect starting point is Unity-FirstHand experience provided by oculus-samples repo.
Again, please refer to previous post on setting up development environment, and make sure various dependencies are installed.
Ensure you have Git LFS installed, run this command:
git lfs install
Then, clone repo using the "Code", opening in Github desktop and running the following command:
git clone https://github.com/oculus-samples/Unity-FirstHand.git
All of the actual project files are in Assets → Project. This folder includes all scripts and assets to run the sample, excluding Interaction SDK itself. The project includes v41 of the Oculus SDK, including Interaction SDK. You can find Interaction SDK in [Assets/Oculus/Interaction]{Assets/Oculus/Interaction).
After installing all required dependencies and configuring build to run on Quest device you will get something similar to above in your editor.
Go to File → Build Settings if you are using Mac.
If you followed instruction from my previous post and connected your device, below is what you should see in Build Settings.
Click Build and Run, allow a few minutes to Unity to build and wait for messages that your app is deploying to connected Quest device.
I strongly suggest you play with this example and try to customize components and scripts to learn how it works internally, to be able to do it head to Project section of your Unity editor and expand project directories hierarchy.
We will be customizing LazerProjectile:
public class LazerProjectile : ActiveStateObserver
{
[SerializeField] Transform _target;
[SerializeField] GameObject _effect;
[SerializeField] float _rayCastDelay = 0.5f;
[SerializeField] float _fadeOutTime = 0.1f;
[SerializeField] float _delayBetweenShots = 0.5f;
[SerializeField] AudioTrigger _chargeUp;
[SerializeField, Optional] AudioTrigger _chargeUpComplete;
protected override void Update()
{
base.Update();
Vector3 endPos = Vector3.Lerp(_target.position, transform.position + transform.forward * 20, 5 * Time.deltaTime);
_target.position = endPos;
}
//......
}
Let’s increase Ray cast delay and test the app on the headset by replacing
float _rayCastDelay = 0.1f;
to
float _rayCastDelay = 0.5f;
Here is how it works!
Try it yourself and let me know what you want to build using hand tracking.