How do I create a sword that follows the sword around the cursor

Godot Version



I have a game and I have some magic abilities. For this I want the abilities to come out a sword/wand but I need to first make the sword. I can easily create the image for the sword, maybe the collisions, but the thing I don’t know how to do is a cursor sword follow feature. Think about the pickaxe in terraria. It’s exactly like that.

1 Like

Check out this part of the docs, I think you’ll find what you’re looking for in regards to aiming/rotating like Terraria

Thanks man but do you mind showing a example. I can’t figure out how to make it so it stays in a circle and the only thing that gets affected is the rotation from the mouse movement

1 Like

For sure! Here is a tutorial relating to a Terraria-like:

Basically, make a new scene with an Area2D node. Attach your sword sprite, collision shape, and animationplayer. I believe this person also uses a timer for timing the “hit” effect. Then refer to the code in the docs and you should have enough pieces between all this to build what you need!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.