Hi! I’m using Godot 4.2.2 and I’m having trouble with my game.
Basically I want my character to be able to move by themselves, like an NPC. This is a Pet Sim game, so I also want to be able to drag them all over the place as well, just as a cute little thing to do.
I got the code for the Drag and Drop function, I used a version of someone else’s code, along with some other modifications.
This is a WIP of the room so far, I got it so you can’t drag them past the room, However, when I drop them, the animation stays as if they’re still being dropped, even though they’re on the ground. I’m wondering if there’s a way to detect that?
I’m wondering if it’s even possible to have them walk around on their own? All the tutorials I looked at use Kinetic or something else. So I’m wondering if I’m even on the right track.
I notice you play a “dropping_idle” animation, maybe you can add a automatic transition from this animation to the regular lidle one?
If it’s an AnimationPlayer, select “dropping_idle”, then click on the Animation button in the panel and select “Edit Transitions”, pick idle as the “Next (Auto Queue)” animation.
If it’s a AnimatedSprite2D you will have to connect to the “animation_finished” signal, then play “idle” on the connected function, kind of like this
func _on_minii_anims_animation_finished() -> void:
if anim.animation == "dropping_idle":
anim.play("idle")