#HOW to use animation on player so that it's body has not a certain tilt?

18 messages Β· Page 1 of 1 (latest)

cunning holly
#

(After teleporting the player facing directly to North/South/East/West) No matter whether I use -this or override_previous_animation when animating the player's body/waist/root, it still has a certain tilt on the Y axis when it's facing directly to North/South/East/West (that's... orthogonally, because I previously teleported it to make that happen).

Then how could I get that? does anyone know? πŸ€”

serene solarBOT
#
Welcome to the help forum!

Please make sure to read #1029468016594911232 as it may answer your question!

Once your question has been resolved, please mark the post as closed by using the </close:1163944441741049897> command.

woven cliff
#

Can you draw in Paint from a top down view what is happening, and what you want to happen?
Or record it in Minecraft and re-explain it?

cunning holly
# woven cliff Can you draw in Paint from a top down view what is happening, and what you want ...

Better explained: I teleported the player facing directly to North/South/East/West, and through animation I want its body/waist/root to be rotated so that the body/waist/root is facing that direction.

The command I use to teleport the player facing directly to one of those directions is this: /tp ~ ~ ~ 0

Sorry I can't reveal some stuff so I should make an example pack and don't have time for it at the moment, but I'll try to do it ASAP! (in a few days or a couple of weeks ^^') πŸ‘

woven cliff
#

Got it.

The core of the solution is to add an animation applying "q.target_y_rotation" on the root group of the player model.
It makes the model face the looking direction of the camera in third person.

#

That or subtracting q.body_y_rotation to the root group, and adding a multiple of 90, determined by a dumy query like q.variant

#

But for both of these solutions, I'm not sure how to transition off to return to normal.

I guess you could apply that new animation in a separate AC, itself applied in the Third person state.

That new AC could just have 2 states: default, and face_root_direction. The latter should apply the custom animation.
It transitions from default to face_root_direction when a dummy query is given, but back to default with "q.ground_speed > 0", so when the player moves

#

That dummy query, you could give it and remove it a short moment later.
You'll decide the conditions depending on what you need I'm sure.

cunning holly
# woven cliff But for both of these solutions, I'm not sure how to transition off to return to...

ohh, that query almost fixes it! although not completely, since now when I (in a single tick) teleport the player (e.g. facing to North) and play the animation then the player model is slightly displaced from its real position (and I can't correct it with some particular offset value since the amount of displacement depends on which direction the player was facing before teleporting them)

#

hahahah so weird yeah 😡

woven cliff
cunning holly
#

yep I just took a look, it's the vanilla player model (I didn't set any custom model) and it's made that way, so I think it has some hardcoded stuff or something

woven cliff
#

I still don't get what's wrong, if you can't show it in game, can you pose the player model in Blockbench and take screenshots to explain what is going on?

cunning holly
#

when the animation ends then the model is not displaced, it is in its real position

cunning holly
cunning holly
#

Hey! already got to solve it by using q.target_y_rotation and also applying some part of the animation for the root bone to the waist and legs, and removing this part from the root bone πŸ˜…

#

I couldn't have done it without your help, tysm! πŸ™Œ πŸ™Œ

woven cliff
#

Cool!