This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

func mouvement_bras():

bras.look_at(get_global_mouse_position())
get_node("collision_main").position = Vector2(main.position)
in Engine by (17 points)

What's your question here? What are you trying to do? What are the node types of bras, collision_main and mainrespectively?

All right so i, i create a rig

bras = Arm Bone
collision_main = collision2d of a the hand
main = hand polygone


I want to move my hand collision with my hand polygone.

How does your scene tree look like? If the CollisionShape2D is a child-node of the Polygon2D, then moving the latter should also move the former - no code required!

Yes, but Collision2d can't be child of 2d polygone

1 Answer

0 votes

You can add a RemoteTransform2D-node as a child of the Polygon2D and set the CollisionShape2D that you want to move as its "Remote Path" in the editor. This way the CollisionShape2D can remain a child of the Player's KinematicBody2D, but will be moved and rotated along with the hand polygon.

by (10,634 points)

enter image description here

It work in the editor but not In the game.

How have you determined that it doesn't work? In the only in-game-screenshot you've provided, one cannot even see the CollisionShapes. Make sure to toggle Debug > Visible Collision Shapes before running the game! Are they in the right place? Do they move with the hand? Which parts are working and which are not?

Everything is working but the collision is not moving as you ca see in the gameplay screenshot where i'm supoosed to fall but my collision support me.

Look: If I could see that from the screenshot I wouldn't have asked. In general: it's not possible to see if something is falling or not by looking at just one screenshot...

This is a waste of my time, sorry. I told you what I know.

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.