#How to stop Camera2D from following the player

6 messages · Page 1 of 1 (latest)

spring perch
#

Hello, i need some help with my code, so i have a camera2D attached to my player, i want to stop following the player when he press the E button, i tried to disable it but the zoom option does not work anymore if i disable the camera , any idea ? I want to have my camera enabled just to stop following the player, i need that without boundaries.

Thank you.

steel badger
#

@spring perch You might try using two cameras.

Camera A on player
Camera B on your scene root

When player presses E have camera B get camera A position
Then disable A and enable B

Not at my computer now so I'm not able to test the code.

What version of godot you using.

spring perch
#

Im using the latest Godot version 4.1, i will try it thank you so much for the info

gloomy quail
#

that way the position would no longer be relative and it would no longer move

#

might be tricky to get but here's some docs you might need to understand how to use remove_child https://docs.godotengine.org/en/stable/classes/class_node.html