question about animated sprite

kekgeniuskekgenius Posts: 7Member
edited January 7 in 2D

I'm using animated sprite and I want to add crouch animation, but what I need to do with collision? I mean it will not change itself.


Tags :

Answers

  • TwistedTwiglegTwistedTwigleg Posts: 1,000Admin
    Answer ✓

    The way I have always done it is just enabling and disabling collision shapes as the animation changes.

    If you are using Godot 3, you can use the disabled property on CollisionShape and CollisionShape2D nodes. If you are using Godot 2, then you'll need to use the set_trigger function, I think. It's been awhile since I've used Godot 2.

    Then you can make a collision shape for each of the animations that need different collision shapes, like one for standing and another for crouching. Then when you change animations, you'll need to disable all of the collision shapes and then enable the specific collision shape you need for that animation.

    Hopefully this helps :smile:

  • kekgeniuskekgenius Posts: 7Member

    @TwistedTwigleg said:
    The way I have always done it is just enabling and disabling collision shapes as the animation changes.

    If you are using Godot 3, you can use the disabled property on CollisionShape and CollisionShape2D nodes. If you are using Godot 2, then you'll need to use the set_trigger function, I think. It's been awhile since I've used Godot 2.

    Then you can make a collision shape for each of the animations that need different collision shapes, like one for standing and another for crouching. Then when you change animations, you'll need to disable all of the collision shapes and then enable the specific collision shape you need for that animation.

    Hopefully this helps :smile:

    Thanks

Sign In or Register to comment.