0 votes

I've Drag effect option in the Camera2D enabled. For player to have some degree of free movement within the Camera2D. But the problem is that the GUI gets same treatment as player node. I don't want GUI to getting same drag effect as "Hero" KinematicBody2D...

How can I prevent Nodes from getting dragged in Camera2D? So parent node basically only should allow dragging the player child, while the GUI is fixed with the Camera2d.

I've example project if you are interested beneath the photo.

Camera node dragging wrong object problem

Project example: https://drive.google.com/open?id=1p5hLM_4aSaTnKjfuTLxenlIu4AM9jYow

in Engine by (101 points)
edited by

If the GUI elements are Control nodes then MouseFilter may help you.

1 Answer

+2 votes
Best answer

set the GUI under a CanvasLayer node, it will print it before repositioning the camera...

do a bit of experiment to really understand how it works

by (1,204 points)
selected by

Thanks, this is what I needed... I really need to experiment with it. Pretty complex, need to change Node structure.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.