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

asked Mar 5, 2018 in Engine by Qws (97 points)
edited Mar 5, 2018 by Qws

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

answered Mar 5, 2018 by rustyStriker (1,073 points)
selected Mar 6, 2018 by Qws

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 How to use this Q&A? before posting your first questions.