Skip to content

How do I assign a phantom Camera to an Area2D and set its limits? #299

Closed Answered by ramokz
itzjeppy asked this question in Question / Help Wanted
Discussion options

You must be logged in to vote

Found the issue.

It doesn't work because you're only assigning the name of the Node in the camera.set_limit_target("CollisionShape2D") inside ChangeCamera.gd.To get it to work, the parameter needs to be a full NodePath. When supplying an invalid NodePath value, it basically resets the limit that you've applied from the inspector. It probably should return an error and prevent resetting the limit, so will add that in as an update soon.

A working code example would then look like:

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@itzjeppy
Comment options

@ramokz
Comment options

@itzjeppy
Comment options

@ramokz
Comment options

Answer selected by itzjeppy
@itzjeppy
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants