#delayed attack, animation not working. Please send help.

1 messages · Page 1 of 1 (latest)

low cairn
#

What it says on the tin. was trying to make a melee attack on an entity with a delayed attack. however the attack animation does not play (entity stands still for attack). this is weird as all other animation work. please send help, I've been stuck on the issue for days.

desert whale
#

send the code in json formating here, i cant see the photos clearly}

#

as in 3 times " ` " followed by " js " followed by your code, followed by other 3 signs like in the begginning

unique lagoon
low cairn
#

oops, hold on

#
"components": {
    "minecraft:health": {
        "max": 10,
        "value": 10
    },
    "minecraft:movement": {
        "value": 0.2
    },
    "minecraft:physics": {},
    "minecraft:jump.static": {},
    "minecraft:movement.basic": {},
    "minecraft:navigation.walk": {
        "can_walk": true
    },
    "minecraft:behavior.random_stroll": {
        "priority": 6,
        "speed_multiplier": 1
    },
    "minecraft:behavior.random_look_around": {
        "priority": 7
    },
    "minecraft:behavior.look_at_player": {
        "priority": 7,
        "look_distance": 6,
        "probability": 0.2
    },
    "minecraft:behavior.hurt_by_target": {
        "priority": 1
    },
    "minecraft:behavior.nearest_attackable_target": {
        "priority": 2,
        "within_radius": 10,
        "reselect_targets": true,
        "entity_types": {
            "filters": {
                "any_of": [
                    {
                        "test": "is_family",
                        "subject": "other",
                        "value": "decepticon"
                    }
                ]
            },
            "max_dist": 10
        },
        "must_see": true,
        "must_see_forget_duration": 0.4
    },
    "minecraft:collision_box": {
        "width": 1,
        "height": 2.9
    },
    "minecraft:behavior.look_at_target": {
        "priority": 7
    },
    "minecraft:type_family": {
        "family": [
            "autobot"
        ]
    },
    "minecraft:attack": {
        "damage": 2
    },
    "minecraft:behavior.delayed_attack": {
        "priority": 0,
        "attack_once": false,
        "reach_multiplier": 3,
        "track_target": true,
        "attack_duration": 0.75,
        "hit_delay_pct": 0.5,
        "melee_fov": 90,
        "random_stop_interval": 0
    }
}
```js
#
"animation_controllers": {
    "controller.animation.autotrooper": {
        "initial_state": "idle",
        "states": {
            "idle": {
                "animations": [
                    "idle"
                ],
                "transitions": [
                    {
                        "walk": "query.ground_speed"
                    },
                    {
                        "attack": "query.is_delayed_attacking"
                    }
                ]
            },
            "walk": {
                "animations": [
                    "walk"
                ],
                "transitions": [
                    {
                        "idle": "!query.ground_speed"
                    },
                    {
                        "attack": "query.is_delayed_attacking"
                    }
                ]
            },
            "attack": {
                "animations": [
                    "attack"
                ],
                "transitions": [
                    {
                        "walk": "query.ground_speed"
                    },
                    {
                        "idle": "!query.is_delayed_attacking"
                    }
                ]
            }
        }
    }
}
```js
low cairn
unique lagoon
#

delayed attack priority: 3

low cairn
unique lagoon
#

How long is your animation?

low cairn
#

0.75 seconds

low cairn
unique lagoon
#

nothing plays? is the attack executed?

low cairn
#

yeah the attack is executed, its just that no animation plays for it.

unique lagoon
#

remove the "walk" transition in the "attack" state

low cairn
low cairn
unique lagoon
#

"query.ground_speed" is activated before your attack animation runs