#How to trigger a first person animation specificaly for an attachable when using it?

1 messages · Page 1 of 1 (latest)

quasi jungle
#

I'm trying to trigger a first person animation for my 3d item but it doesn't seem to work when I'm using it

#

How to trigger a first person animation specificaly for an attachable when using it?

trail wind
#

There is a tutorial on wiki on how to create first person animations for your item.

#

and use c.is_first_person not v or q.

quasi jungle
trail wind
#

When you're using the item, it disappears ?

#

and is fine normally?

quasi jungle
#

I'm trying to add a muzzle flash animation for my 3d item which is a gun and I want it to be only triggered when I'm using the item(right-clicking)

trail wind
quasi jungle
#

I'm not sure tho but my 3d item is working when I'm holding it

trail wind
#

I think I can understand.

quasi jungle
#

do you want to check it out?

#

I can dm you the files and check it for you to understand it

trail wind
#

I'm assuming you're just using q.is_using_item to trigger it.

#

You know what ? I need your code.

#

send it here or DM me.

quasi jungle
#

c.owning_entity && q.is_using_item?

#

something like that

quasi jungle
trail wind
#

send your code. I'll fix it for you.

quasi jungle
#

and the animation, I believe there's an animation named shogun_fire something like that inside the animation file

trail wind
#

You're attachable has nothing.

quasi jungle
#

oh I forgot that I removed it before I sleep last night

#

but before I removed it it is not working

trail wind
#

The 1st and 2nd animations will always play.

#

The 3rd animation will only play when you're using the item.

#

Am I correct ?

quasi jungle
#

here's the updated one

#

I added the fire animation

#

the third person animation is working

#

the first person too

#

the firing animation is the only problem

trail wind
# quasi jungle exactly
{
  "format_version": "1.19.0",
  "minecraft:attachable": {
    "description": {
      "identifier": "tf2:shotgun",
      "materials": {
        "default": "entity_alphatest"
      },
      "textures": {
        "default": "textures/entity/shotgun"
      },
      "geometry": {
        "default": "geometry.shotgun"
      },
      "animations": {
        "first_person": "animation.shotgun.first_person",
        "shotgun_fire": "animation.shotgun.shotgun_fire"
      },
      "scripts": {
        "animate": [
          {
            "first_person": "c.is_first_person"
          },
          {
            "shotgun_fire": "c.is_first_person && c.owning_entity -> q.is_using_item && query.is_item_name_any('slot.weapon.mainhand', 0, 'tf2:shotgun')"
          }
        ]
      },
      "render_controllers": [
        "controller.render.default"
      ]
    }
  }
}
quasi jungle
#

okay I will try that out

trail wind
quasi jungle
#

so I just need to put the first 2 queries?

#

I mean the first 3 including the q is using

trail wind
quasi jungle
#

it didn't work

trail wind
#

Uhm, Uhm, I added a space instead of an underscore.