How to SLOWLY pan the camera?

Upon boss enemy encounter, I want to switch/pan the camera from the player to the boss enemy SLOWLY (Not in an nstant switch), then return again the camera focus to player.

Advance thank you for those who reply.

Center camera on a object.
Normally(ie when not in encounter with boss):
set screen variable to 0 & center the object on player.

When encounter with boss :
set the screen variable to 1. Trigger once
When screen variable =1 then apply permanent force to the obj to move towards the boss. (trigger once)

When obj reach to boss (ie collision) then stop obj and apply permanent force to move to player. set screen variable to 0.(Trigger once)

I think this will do.

1 Like

Prashant Gyawali’s suggestion will work. You definitely want some kind of “Cutscene” Variable (Global or scene) that you can trigger.

This will be important because you don’t only need to slowly move the camera, you need to ensure you don’t cause a conflict with your normal Camera movement. With a Cutscene Variable, you can add a condition of “Scene Variable “Cutscene” = 0” to your normal camera events, and a “Scene Variable “Cutscene” = 1” to your actual “Pan” events.

Here’s how I did it in my Not-A-Vania demo (“BossRoom” being my cutscene variable):

Normal Camera events:

Boss Room “Cutscene” which includes panning the camera:

This was my first time ever doing something with GDevelop, so I don’t recommend hard coding your X positions like I did (probably better off using some sort of placeholder object so you can move it, or whatever), but this gives you the general idea. You can play the demo here, as well as download the project files for yourself: Not-A-Vania by Silver-Streak

1 Like