+1 vote

Hi,
I have a 2d character with ranged weapon. I want it to aim to the position of the mouse (like for example, aiming in worms game, but with mouse). My question is, how can i make arms and head look at mouse but remain rest of the body on idle?

I was thinking in adding 4 sprites to my kinematicbody2d, one for each arm, one for head, and one for the rest... then aply rotation to arms and head acording to mouse position. Is this the correct way to do so?

I'm new to godot engine.

Thanks

in Engine by (3,382 points)

1 Answer

+1 vote
Best answer

The arms wouldn't really need collisions but yes the idea is that the arms would be separate from the body; at least if you want a worms style game.

Take a look at the Godot 2D movement overview to get some idea of what your options are for rotating the arms.
http://docs.godotengine.org/en/3.0/tutorials/2d/2d_movement.html

You could also use animations and many other tricks.

by (1,434 points)
selected by

Thanks a lot!
I'll go with sepparate parts for the body then... i just wanted to know if it was a good idea or not! Thanks!

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.
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 webmaster@godotengine.org with your username.