Need help with coding a movable 3D camera and jump function

So, I recently I started using Playcanvas and I have been trying to figure out how to make a camera that is controllable by the mouse and how to make my character jump. So far I have tried to use other people’s code, but when I try to implement it, it has error codes in it. I am relatively new to code, and so I don’t know where to implement the code. Any help would be much appreciated. Also note that my game is in a 3rd person view and that the main character is a ball. Thanks.

Hi @Happytrap44 and welcome!

The first project of PlayCanvas where you normally start with, sounds exactly what you describe! :partying_face:

There is a also a third person tutorial project that can get you started.

The my first project is what I have started with. I am currently trying to tinker with the code.

Ah, I get it. I hope the third person tutorial project can help you with that.

I have tried to put the code from the CameraMovement.js into the follow.js in the ‘My First Project’ but it came up with an error. I don’t know if it can’t find the entity or something. Do I need to create a new camera for the new code?

Probably the script name that you use in your script (CameraMovement) doesn’t match with the actually script name (follow) anymore. It’s better to download and import the new script and disable the old script.

I tried this, but it didn’t work. I am thinking that because the code doesn’t say what the target entity is. Maybe it doesn’t know what to choose? Or maybe I need to also import the PlayerMovement.js code also?

So, I tried that . . . but it didn’t work.

HI! @Happytrap44 Are you looking for a first person movement script?

No, the code is for 3D person

for movable cameras and movment try looking at this

it is for first person movement but for third person move the cam behind the player entity so you can see the player on game start.
If you still need help after leave a comment and I will write out a third person movement script for you

Okay, thanks :slight_smile:

There is also a third person tutorial project.