- Home /
Question by
alexjadkins · Dec 27, 2020 at 11:15 PM ·
directionblend tree
Can you change blend tree's reference?
I'm making a 2d sprite based procedural dungeon crawler. One of my enemy types is stationary and uses a cannon to fire a projectile at the player. I have made 4 directional animations for when this enemy is idle and attacking. I'm using a blend tree that compares the player's x and y in order to discern which animation should play. However the blend tree isn't comparing the player's x and y to the object's x and y. It's comparing it to (0,0) in scene. How can I change what the blend tree is referencing?
Comment
Best Answer
Answer by alexjadkins · Dec 28, 2020 at 12:38 AM
Instead of keeping track of the player's x and y, I've used this page in order to normalize the directions to work with the blend trees,