I am evaluating playcanvas and so far I like it. I am using the tutorials to learn and right now I’m playing with the FPS Character Controller. I have one question though - what is the easiest way to have the actual character (Geometry entity) facing the same direction as the camera? My character is not round as in the tutorial, and I need to have it heading the right direction at all times.
I would take the camera’s ‘look at’ vector (cameraEntity.forward), project it onto the XZ (floor) plane and do a Math.atan2 calculation on the x and z components of the projected vector to figure out the camera’s angular rotation around the world Y axis. Then, just called playerGeometryEntity.setEulerAngles(0, yRot, 0);