#Attack Animation

4 messages · Page 1 of 1 (latest)

pale vortex
#

I'm trying to add custom attack animation to my entity. I thought this way it could work, but the animation does not get triggered at all. I want the animation to be played only when the entity actually deals damage to the target. When I use only query.can_damage_nearby_mobs the animation plays all the time. Ty for the answers in advance. Minecraft Stable version

        "controller.animation.animal.hit" : {
            "initial_state" : "default",
            "states" : {
                "attack" : {
                    "animations" : [ "attack" ],
                    "transitions": [
                        {
                            "default" : "!variable.has_target || variable.attack_time < 0.0 && !query.can_damage_nearby_mobs"
                        }
                    ]
                },
                "default" : {
                    "transitions" : [
                        {
                            "attack": "variable.has_target && variable.attack_time >= 0.0 && query.can_damage_nearby_mobs"
                        }
                    ]
                }
            }
        }
warm creek
#

variable.attack_time has a resting value of 0, so your transition to the attack state should be using > 0

#

That's not really the problem though—I'm more curious about what variable.has_target is?

pale vortex