0 votes

I'm a beginner in Godot, and I have a problem.
I do not know about. I need your help.
I created the joystick for the android game. Actually MultiTouch.

Scene Scheme:
• Canvas Layer







The problem is that when player are moving, CollisionShape2D does not move along with Circles + (player + camera), but they stay in place.

How do we make CollisionShape2D move along with joysticks (circles) and player?

Please help me.

asked Nov 25, 2018 in Engine by Mejro (15 points)
retagged Nov 25, 2018 by Mejro

What exactly is it you are moving...???
If not Area2D_* then the CollisionShapes are not children of the right parent nodes...

Here is a video about what does it do and what it should do

I know what you mean, but I have CanvasLayer as the main node.
He, as I know, should have all his children attached to the screen
On the video you can see that the circles work with the canvas layer correctly. But CollisionShape2D remain in their position towards the world, not toward CanvasLayer

And since Circles remain in position toward Canvas Layer So I think Area2D too

And I need to know how to fix it or do it

Honestly, I don't get (even by repeatedly watching the video) what is working as intended and what is not, but that doesn't matter anyways...

I'll try to state the obvious, just to make sure the general concept is made clear...

Usually one won't want to move a collision shape, but one would want to move a collisionshape's parent...(which should be of an appropriate node type to be moved)...which may or may not lead to a collision that can be detected from both sides, the moving object's perspective and the collider's perspective...

I have no idea, at this point of time, what it is you want to move or collide with in the first place...

Maybe it would be more helpful if you would provide the relevant parts of your code so one could inspect what you are trying to do...

Maybe there is no problem in CollisionShape2D.. Maybe in my code..

enter image description here

Area 2DR is right area for player rotation
and Area 2DL is left area for player movement <<< Screen

The player simply moves away from these two areas for touch


I'm sorry.. I don't quite understand myself to explain it...

1 Answer

+1 vote
Best answer

You are probably facing this issue

Which should be solved by 3.1

A workaround for that may be placing the Area nodes on the main layer and attach these with RemoteTransform nodes or by code to move these when the visual representation on the CanvasLayer moves.

Kind of messy but the other option is to wait for 3.1

answered Nov 25, 2018 by eons (7,784 points)
selected Nov 25, 2018 by Mejro

Well, it seems that 3.0.7 may include the fix too

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.