I have created a player with CharacterBody2D added CollisionShape2D and AnimatedSprite2D to it also added touch screen button for touch controls. And everything was working perfectly until I added Camera2D to the player.
After adding it I am facing this issues.
-
The camera won't follow the player no matter what I do.
-
If I try to enable the camera from script in ready function using func _ready():
$Camera2D.make_current()
The player will get stuck in a single spot but the movement and animations work. -
If I force to manually using
$Camera2D.position = position in physics process the movements and animations are reversed but the camera won't follow the player.
Finally if delete the Camera2D everything works fine.