First Person View
First Person View - PlayCanvas Plugin Guide for Convai integration.
Adding Physics components to plane
Scale up the plane and add physics component to it. Add both collision and rigidbody.
Import Ammo Js (enables physics). Scale up the Collision component according to the plane size.

Player Body
Create a New Entity
In the PlayCanvas Editor, right-click in the Hierarchy panel and select "Create New Entity".
Add Physics Component
With the new entity selected, click the "Add Component" button in the top-right corner of the Editor.
Search for "Physics" and add the "Physics" component to the entity.
Add Collision Capsule Component
With the entity still selected, click "Add Component" again.
Search for "Collision" and add the "Collision Capsule" component to the entity.
Adjust Entity Y-Position
Adjust the "Y" value of the Translation to position the entity above the plane.
Add Rigidbody Component
With the entity still selected, click "Add Component" again.
Search for "Rigidbody" and add the "Rigidbody" component to the entity.
Set the "Type" of the rigidbody to "Dynamic".
Adjust Angular Factors
In the Rigidbody component, locate the "Angular Factor" section.
Set the "X", "Y", and "Z" values of the Angular Factor to 0.

Camera controls for first person view
Create a FirstPersonView.js script and add the bellow code. You can find examples for implementing camera controls on PlayCanvas documentation and examples as well. Attach this script to Player capsule.
Last updated
Was this helpful?