How to make first person camera with collision

hi monkeys :wink: i am making a first person camera in my game.

my idea is create a node whit an capsulecollisionshape attached, and place cam inside capsule.

in this way my camera can collide with other objects,but i have to move also this node whit my camera for obtain collision effects.

in youe opinion this is a good idea or there is a better idea?

thanks a lot :wink:

Sounds good, you have the CameraNode for that btw. Just attach the CharacterControl and Camera and you should be good to go :slight_smile: Best disable the flycam, you can rotate the viewDirection vector of the character based on the mouse input to move the camera.

ok :wink: now i try and after i post result :wink:

i have another idea :wink: i can use a chase camera and in target i can set node with collisionshape.

in this way when i move camera i move also the node :wink: is it true? :wink:

Yeah sure, thats what the TestWalkingChar does.

in chase camera target can stay in same location of camera? in this way a make a characterControl with collisionshape (that is a target) and i place it in same location of camera (in this way camera is inside of collision shape) :wink:

ok i found answer :wink: yes with chasecamera i can do this :wink: jmonkeys is god :wink:

for do this,just set default distance to target to 0 :wink:


ChaseCamera chaseCamera = new ChaseCameta(camera,target,inputManager);