Get entity to move with the fps camera

Hello I am making a FPS game and i used the FPS script to get the first person movement but i dont know how to get my character and weapon to rotate with the camera can anyone help i would greatly appreciate it! Here is the project PlayCanvas | HTML5 Game Engine

You can do a couple of things:

  • Make the character and weapons child entities of the camera (you will have to take into consideration that the player is only going to see hands and the weapon and not the full body).
  • Update the character/weapons position and orientation to match the camera in update/post update.
  • Have the camera as the child of the character and change the controls to move and rotate the character.

I personally would have the controls directly move the character and rotate the character’s ‘head’ and then update the camera’s positions and rotation separate in a script somewhere.

Ok Thanks! But i have a full body character because my aim is to make it multiplayer.

There’s a difference for a player to see his/her own character and for other players to see them.

A lot of games do this where they don’t render the player’s character unless the camera changes from first to third person camera.

ah ik what you mean now. thanks!

Hey guys, still getting the same problem. How can i fix my gun object with camera.

i am also having this problem any way to dothis?

This post covers how you would do this:

If you are having trouble, please post a new thread with the project link and what problems you are having

I cant move or look around plz help

@James_Edgmon Hi could you post to a new topic and make sure you post a link to you project so someone can have a look.