Others Help with interactable 2D scene in Godot

Fritto

New Member
Sep 25, 2019
6
7
138
Hello,
I should mention that I only recently started using Godot, and I would like to create an interactive scene like this :

You don't have permission to view the spoiler content. Log in or register now.


I don't need help with animation but, I was wondering how I can use the mouse to interact with different parts of the body or clothing, moving or adjusting them. Do you know of any tutorials? Or do you have the patience to explain which approach you would use in Godot to achieve a result similar or better than the one in my example?
To make it clearer, I'll leave the link to the game I'm referring to

 

Winterfire

Conversation Conqueror
Respected User
Game Developer
Sep 27, 2018
6,523
9,364
800
Google it.
"godot how to detect if i clicked gameobject"
returns as first result, seems fairly new, but maybe it's old by now.

Other ways would be to use a transparent button (how you'd do it in renpy), or use raycasting.
 

basnalex

New Member
Jan 29, 2018
14
9
191
If there are overlapping sections it can get difficult, but you can use Area2D nodes for something like this. I would probably start with a parent node that has the sprite and animation player in it. Then create a custom node that extends Area2D connected to the signals for mouse_entered and exited. Next add a boolean to the new Area2D of is_hovered and then when mouse_entered is emitted is_hovered is true and mouse_exited changes it back to false.

Once you know if the area is hovered, you can then check for a click or other input and if hovered, tell the animation player to play X animation or have the character do something.