#How to trigger a first person animation specificaly for an attachable when using it?
1 messages · Page 1 of 1 (latest)
How to trigger a first person animation specificaly for an attachable when using it?
Your item is probably behind you.
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.
it is rendering correctly when in first_person
So, what's the issue ?
When you're using the item, it disappears ?
and is fine normally?
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)
Hmm, so you don't know how to display an attachable if the player is using an item ?
I'm not sure tho but my 3d item is working when I'm holding it
I think I can understand.
do you want to check it out?
I can dm you the files and check it for you to understand it
Please use c.owning_entity -> q.is_using_item to trigger it.
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.
sure
No
send your code. I'll fix it for you.
here's the attachable
the model
and the animation, I believe there's an animation named shogun_fire something like that inside the animation file
How you're playing this animations ?
You're attachable has nothing.
oh I forgot that I removed it before I sleep last night
but before I removed it it is not working
Oh, so you want me to add them to your attachable ?
The 1st and 2nd animations will always play.
The 3rd animation will only play when you're using the item.
Am I correct ?
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
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"
]
}
}
}
okay I will try that out
By the way, you don't really need the q.is_item_name_any here if the attachable is in main hand.
so I just need to put the first 2 queries?
I mean the first 3 including the q is using
I just said you don't need. It doesn't means you can't have it. Please just copy paste what I sent and check it out in-game.
it didn't work
Any content log errors ?
Uhm, Uhm, I added a space instead of an underscore.