How to recenter with code?

Hi, I was wondering If you could recenter the screen with code, like that button right next to the play button does.

This post was flagged by the community and is temporarily hidden.

@UnkLos_Us there’s not really a literal update() function or keyIsPressed variable. so that code will not work in its current state.

@Dimitri_Psicharis if you are using a vcam:


then you can check for a key press or button press with code.

My Project4-12-2024_21-31-10.wick (4.4 KB)

the vcam in this sample project is exactly what you will get when you import it. check the code in the frame and you’ll see what i’m doing to reposition the vcam.

i’m assuming you want this functionality for a game. if you are asking for a keyboard shortcut in the editor, unfortunately i don’t think there is one so you’ll just have to press the button manually.

1 Like

Thanks @awc95014, I am using a Vcam so that the camera follows the player. And I will try what @UnkLos_Us suggested in the default script. Thanks!