Orbiting Camera

Hey guys I’m new to this just started yesterday so sorry if I don’t explain myself well. I’m trying to make a point and click game where the camera will follow along with the player but will be rotatable with the middle mouse button and also zoomable with the middle mouse button similar to RuneScape. Right now the problem I’m having is getting the camera to follow along with the player. I’ve been screwing around with this for like 3 hours now and haven’t gotten anywhere. Tried looking at other projects to find out what I’m doing wrong but I think I’ve just been staring at a basic problem for too long. Here is a link to the project: https://playcanvas.com/editor/scene/602597

var CameraFollow = pc.createScript('cameraFollow');

CameraFollow.attributes.add('cameraEntity', {type: 'entity', title: 'Camera Entity'});
CameraFollow.attributes.add('playerEntity', {type: 'entity', title: 'Target'});
CameraFollow.attributes.add('floatDistance', {type: 'number', default: 0, title: 'Distance'});

// initialize code called once per entity
CameraFollow.prototype.initialize = function() {

// update code called every frame
CameraFollow.prototype.update = function(dt) {
     this.cameraEntity.setPosition.z = this.playerEntity.getPosition.z - this.floatDistance;
     this.cameraEntity.setPosition.y = this.PlayerEntity.getPosition.y;
     this.cameraEntity.setPosition.x = this.PlayerEntity.getPosition.x;

This code is a far from finished it’s just what I have right now.

EDIT: I actually realized that my script wasn’t saving because of a glitch with the script editor, I refreshed and it’s fixed now.