#Trying to make Idle / Walking / Running animations for an entity, wont work.

1 messages · Page 1 of 1 (latest)

twilit herald
#

you need an initial_state in your animation controller, also from what I see you are trying to make animation transitions, but they are not done that way

#

@strange cairn I'm going to correct that part for you, it's not very difficult to understand.

strange cairn
twilit herald
#

{
"format_version": "1.10.0",
"animation_controllers": {
"controller.animation.agito.movement": {
"initial_state": "static",
"states": {
"static": {
"animations": [
"static"
],
"transitions": [
{
"move": "query.modified_move_speed > 0 && query.modified_move_speed < 0.3"
},
{
"sprint": "query.modified_move_speed >= 0.3"
}
]
},
"move": {
"animations": [
"move"
],
"transitions": [
{
"static": "query.modified_move_speed == 0"
},
{
"sprint": "query.modified_move_speed >= 0.3"
}
]
},
"sprint": {
"animations": [
"sprint"
],
"transitions": [
{
"static": "query.modified_move_speed ==0"
},
{
"move": "query.modified_move_speed > 0 && query.modified_move_speed < 0.3"
}
]
}
}
}
}
}

strange cairn
twilit herald
#

Although I think adding a value to query.modified_move_speed doesn't work well, I think I tried it once and it didn't work, why the speed change?

strange cairn
twilit herald
#

Ok to do that there is a more reliable way. but try to try that

strange cairn
#

Thats the only anim that wont play, the running and walking anims play, is there a problem with it or.. idk

twilit herald
#

If it doesn't work very well like that, I'll write you one that works without fail.

strange cairn
twilit herald
#

there correct some mistakes made in this message, try to test that while

strange cairn
#

yea il test rq

twilit herald
#

{
"format_version": "1.10.0",
"animation_controllers": {
"controller.animation.agito.movement": {
"initial_state": "static",
"states": {
"static": {
"animations": [
"move"
],
"transitions": [
{
"move": "query.ground_speed>0.1&&!query.has_target"
},
{
"sprint": "query.ground_speed>0.1&&query.has_target"
}
]
},
"move": {
"animations": [
"move"
],
"transitions": [
{
"static": "query.ground_speed<0.1"
},
{
"sprint": "query.ground_speed>0.1&&query.has_target"
}
]
},
"sprint": {
"animations": [
"sprint"
],
"transitions": [
{
"static": "query.ground_speed<0.1"
},
{
"move": "query.ground_speed>0.1&&!query.has_target"
}
]
}
}
}
}
}
OK, that should work

strange cairn
#

is there something wrong with my entity's code possibly?

strange cairn
#

same thing happens idk its weird

twilit herald
#

ah I saw it, yes there is an error in your entity, in the script just leave the animation controller

twilit herald
#

oh

#

xd

strange cairn
#

I changed that a bit ago ngl

twilit herald
#

yes

strange cairn
#

I saw it in another post and I saw mine was incorrect

#

lol

#

the only animation that isnt playing is the idle one (the 'static' one) which is weird

twilit herald
#

It's really not very difficult, something must be interfering, there is no command block executing the animation

strange cairn
#

nah theres no command blocks involved, the one I placed in the video was to keep it still to see if the idle anim played

twilit herald
#

{
"format_version": "1.10.0",
"animation_controllers": {
"controller.animation.agito.movement": {
"initial_state": "static",
"states": {
"static": {
"animations": [
"static"
],
"transitions": [
{
"move": "query.ground_speed>0.1&&!query.has_target"
},
{
"sprint": "query.ground_speed>0.1&&query.has_target"
}
]
},
"move": {
"animations": [
"move"
],
"transitions": [
{
"static": "query.ground_speed<0.1"
},
{
"sprint": "query.ground_speed>0.1&&query.has_target"
}
]
},
"sprint": {
"animations": [
"sprint"
],
"transitions": [
{
"static": "query.ground_speed<0.1"
},
{
"move": "query.ground_speed>0.1&&!query.has_target"
}
]
}
}
}
}
}

strange cairn
#

and theyre all named correctly too

twilit herald
#

I was wrong in a word and I changed it

strange cairn
twilit herald
#

move==> static

#

XD

strange cairn
twilit herald
#

it's not possible

strange cairn
#

im using what u sent

#

and theres the entity file too.. idk whats wrong'

twilit herald
#

you didn't change it

#

{
"format_version": "1.10.0",
"animation_controllers": {
"controller.animation.agito.movement": {
"initial_state": "static",
"states": {
"static": {
"animations": [
"static"
], "blend_transition":0.2,
"transitions": [
{
"move": "query.ground_speed>0.1&&!query.has_target"
},
{
"sprint": "query.ground_speed>0.1&&query.has_target"
}
]
},
"move": {
"animations": [
"move"
], "blend_transition":0.2,
"transitions": [
{
"static": "query.ground_speed<0.1"
},
{
"sprint": "query.ground_speed>0.1&&query.has_target"
}
]
},
"sprint": {
"animations": [
"sprint"
], "blend_transition":0.2,
"transitions": [
{
"static": "query.ground_speed<0.1"
},
{
"move": "query.ground_speed>0.1&&!query.has_target"
}
]
}
}
}
}
}

#

That's how it has to be, also add blend transition so it's not a rough change

strange cairn
#

did I not? idk leme use that rq

#

@twilit herald YES it works but also one thing do you think you could make another version with the same format as before without the !has_target things, because I wanted to make another entity that I can control when it walks slowly, so I can give it speed to make it play the sprint animation and I can give it slowness to make it walk slowly (basically using the ground_speed stuff) I hope thats not too much to ask and thank you alot 🙏 👍 🔥

#

I hope im not being a pain lol

twilit herald
#

I'm not sure it works but oh well

strange cairn
#

its worth a shot

twilit herald
#

{
"format_version": "1.10.0",
"animation_controllers": {
"controller.animation.agito.movement": {
"initial_state": "static",
"states": {
"static": {
"animations": [
"static"
],
"blend_transition": 0.2,
"transitions": [
{
"move": "query.ground_speed>0.1&&query.ground_speed<0.3"
},
{
"sprint": "query.ground_speed>0.3"
}
]
},
"move": {
"animations": [
"move"
],
"blend_transition": 0.2,
"transitions": [
{
"static": "query.ground_speed<0.1"
},
{
"sprint": "query.ground_speed>0.3"
}
]
},
"sprint": {
"animations": [
"sprint"
],
"blend_transition": 0.2,
"transitions": [
{
"static": "query.ground_speed<0.1"
},
{
"move": "query.ground_speed>0.1&&query.ground_speed<0.3"
}
]
}
}
}
}
}

strange cairn
#

alr ima give it a shot rq

#

thanks alot for the help btw

strange cairn
twilit herald
#

Of course, like I told you, that's not very precise, try it, I gave up on that.

strange cairn
#

so since I wanted to be able to choose when to make it slow and when to make it fast

strange cairn
#

idk how id use has_tag in an animation controller tho tbh

twilit herald
#

you can use properties, mark_variant, variant

#

I really don't know what system you use to change speeds.

strange cairn
#

{
"format_version": "1.10.0",
"animation_controllers": {
"controller.animation.agito.movement": {
"initial_state": "static",
"states": {
"static": {
"animations": [
"static"
], "blend_transition":0.2,
"transitions": [
{
"move": "query.ground_speed > 0.1 && !query.has_tag('sprinting')"
},
{
"sprint": "query.ground_speed > 0.1 && query.has_tag('sprinting')"
}
]
},
"move": {
"animations": [
"move"
], "blend_transition":0.2,
"transitions": [
{
"static": "query.ground_speed < 0.1"
},
{
"sprint": "query.ground_speed > 0.1 && query.has_tag('sprinting')"
}
]
},
"sprint": {
"animations": [
"sprint"
], "blend_transition":0.2,
"transitions": [
{
"static": "query.ground_speed < 0.1"
},
{
"move": "query.ground_speed > 0.1 && !query.has_tag('sprinting')"
}
]
}
}
}
}
}

#

tried to change it so I give it a sprinting tag

#

but it only plays the idle anim lol

#

did i do something wrong ☠️

strange cairn
twilit herald
#

I see, the options are limited

twilit herald
#

that is used in blocks and items

strange cairn
#

oh u cant use tags in animation controllers?

near cloak
#

Im sure you know but

#

If there’s something tag related use a score instead

#

That could work

strange cairn
twilit herald
#

You can try it, but in the description it says that it is only used in blocks, and I think it is also used in items

strange cairn
twilit herald
#

scores do not sync well with the resource pack

near cloak
#

Oh

strange cairn
#

o

#

well how would I make it so that the entity starts sprinting when I want it to then

twilit herald
#

query.scoreboard('example')==0

near cloak
strange cairn
#

K i'll try that

near cloak
#

If heroic has some type of detect add-on stuff going then when the entity has 1 on the detectors sprinting scoreboard set 1 to yours

near cloak
strange cairn
#

{
"format_version": "1.10.0",
"animation_controllers": {
"controller.animation.agito.movement": {
"initial_state": "static",
"states": {
"static": {
"animations": [
"static"
], "blend_transition": 0.2,
"transitions": [
{
"move": "query.ground_speed > 0.1 && query.scoreboard('sprint') == 1"
},
{
"sprint": "query.ground_speed > 0.1 && query.scoreboard('sprint') == 1"
}
]
},
"move": {
"animations": [
"move"
], "blend_transition": 0.2,
"transitions": [
{
"static": "query.ground_speed < 0.1 || query.scoreboard('sprint') != 1"
},
{
"sprint": "query.ground_speed > 0.1 && query.scoreboard('sprint') == 1"
}
]
},
"sprint": {
"animations": [
"sprint"
], "blend_transition": 0.2,
"transitions": [
{
"static": "query.ground_speed < 0.1 || query.scoreboard('sprint') != 1"
},
{
"move": "query.ground_speed > 0.1 && query.scoreboard('sprint') != 1"
}
]
}
}
}
}
}

near cloak
#

I think your good but see what spartan says

strange cairn
#

i used scoreboards like he sent

near cloak
#

Oof

twilit herald
#

but it doesn't work with the resource pack, if you want it to work you need to use this command
scoreboard objectives setdisplay sidebar example

near cloak
#

Yuh

#

Also you need a for the score to go up in game

strange cairn
#

aactually

#

i just thought of something

twilit herald
#

really the easiest way is to use mark variant

round drift
#

I just thought of a way I can do it (btw same person speaking here)

#

See I wanted the entity to spawn in and slowly walk towards the player for a good 10 seconds like menacingly, so i ma just make a 10 sec animation that plays for that instead

#

Anyways @twilit herald Thanks alot for the help with the anim controller, Ima be using that cuz it works 👍

twilit herald
#

ahh.. if you want to do that there is a better way to do it using "query.get_nearby_entities(3, 'minecraft:player')"

round drift
#

nah it should work well

twilit herald
#

3= distance