#Blend tree transition is being interrupted

1 messages · Page 1 of 1 (latest)

naive kayak
#

Hi, I made a blend tree for the animation of my player and I choose between the blend tree and idle on a variable speed which I determine through a script with this code: animator.SetFloat(Speed,movement.sqrmagnitude) but when I turn the player the idle animation pops up and then it switches directions. Any fixes?

#

and the speed variable suddenly changes to 0

#

and then to 1

tough spade
#

I would think idle motion should be in the blend tree

#

Blend from idle to walk to run

naive kayak
#

can i send vid so you understand me better

tough spade
#

I’m not sure what you want to do to be honest

naive kayak
#

when i move horizontally

#

its kind of glitchy

tough spade
#

It’s doing exactly what you tell it to do

naive kayak
#

because for a frame it switches back to idle because for some reason the speed variable changes to 0

tough spade
#

I wouldn’t even use blend tree for this

naive kayak
tough spade
#

Let me ask you this what is your blend tree doing?

#

Or better yet why did you choose to use a blend tree?

naive kayak
tough spade
#

So why not include the idle in here??

#

Wouldn’t it make more sense for it to be there?

#

And regardless what do you want to happen when horizontal and vertical are 0?

naive kayak
#

nothing

tough spade
#

Clarify what nothing means

naive kayak
#

well i have a transition outside the blend tree that changes from idle to blend tree when speed is more than 0.01

tough spade
#

Ok I understand that

naive kayak
#

and one for blend tree to idle if speed is less than 0.01

tough spade
#

Ok

naive kayak
#

but for a frame when i change directions the speed variable changes to 0 causing the blend tree to idle transition to happen and i don't want that i want smooth turning

tough spade
#

Not sure what smooth turning means

#

Like if you are moving left then want to go right your character would look down or up first?

naive kayak
#

my character changes to the idle animation for like a frame when he goes left to right or right to left

#

its because of movement.sqrmagnitude but i don't know how to fix it

tough spade
#

Well with how you have it set up I don’t see a way around it. I wouldn’t use a blend tree here because you don’t want to blend motion to motion. You literally just want to go from motion to motion it seems

#

Or find better logic for the transitions

#

I usually try to do things from script and not use animation transitions

naive kayak
#

https://www.youtube.com/watch?v=whzomFgjT50 in this video it doesn't do that and he's using a blend tree

Let's have a look at the easiest and best way to make top-down movement in Unity!

Get costumized art for your game with Outstandly! https://www.outstandly.com/art_for_games/?Brackeys=love

👾 JOIN THE GAME JAM!! https://itch.io/jam/cgj

Thanks to everyone participating in the planning of the jam:

BlackThornProd: https://bit.ly/2GqgkqO
Dani: ht...

▶ Play video
tough spade
#

I don’t know what to tell you except you missed something in the tutorial

naive kayak
#

i don't know what i did wrong