ChaseCam without rotation?

Hello,



I want to have a camera that follows my player’s movements. The chasecam does this fine. Only problem I have is that I want the chasecam to be fixed. It shouldn’t be able to rotate with the mouse or zoom in/out.



How can I achieve this?

Hey,



I am actually pretty new with JME… but mabye this could help you !?

[java] chaser.setToggleRotationTrigger(new MouseButtonTrigger(MouseInput.BUTTON_RIGHT), new KeyTrigger(KeyInput.KEY_SPACE)); [/java]

it disables the mouseButton_Right (in this case) and puts the function on Key_Space… I guess its not the best way, but

mabye you could just “place” the rotate function on keyes, nobody will use?

But then there is still the zoom function… so not really a good answer I guess… but mabye better than nothing?

Use the constructor without the inputManager, and no input will be registered.



ChaseCamera chaseCam=new ChaseCamera(cam);

spatial.addControl(chaseCam);

Sorry for bringing up this old thread, but I had the same problem and found a nice solution.

I thought, sharing it with other/new users would be a good thing: :slight_smile:

[java]chaseCam.setZoomInTrigger(new Trigger[]{});

chaseCam.setZoomOutTrigger(new Trigger[]{});[/java]



So you just clear the list of triggers especially for the zoom options. :slight_smile:

1 Like