How to change chasecam's target

hi there ,
for my game i modeled my character twice, once with a pistol and once with a machine gun.
While the game is running i want to switch between them. Sounds easy but somehow i dont get it…
since i created two chasecams and enable and disable them i get strange optical bugs… - the cam follows but the player jiggles-

maybe there is something with the order of controls??
or maybe there is a simple way… like chasecam.setTarget(pistolman); <---- dont find such a method

would be nice if someone had a solution

First, make sure you disable the FlyCam.
I think you can or use 2 instances of ChaseCam, or use the setSpatial method.

use the setSpatial method.
Nope, don't do this. The chaaseCam is a control like any other, you have to add it to the spatial the regular way, spatial.addControl(chaseCam).
1 Like

Have a player node, have the chasecam follow that. Add pistol/whatever inside player node. Move player node through the scene…

mhm… as i mensioned it above i already got the cam follow, but when i move the character jiggles somehow… maybe my mistake is to use the same characterControl

when i switch i do this:

mgman.addcontrol(character); /// character is charactercontrol ///

maybe this brings the controls out of order or something like that?
Im new in jmonkey :slight_smile:

i really dont know why but,
since i call the switchWeapon() method twice… it works :D:D

not really professionel, but for my first game it will be alright …