Sprite and direction
In the previous Unreal Engine project I had an arrow component attached the to character to determine in which direction to shoot projectiles. However, the sprite would only face left or right. With Garden 2's 8-directionality I had to figure out how to rotate the arrow properly since the animations themselves don't rotate the character.
So I added a piece of code to set the rotation of the arrow component when movement input is detected.
![]() |
| The code to rotate the arrow component. |
![]() |
| The arrow is always pointing right of the character. |
To do this I created a cube in which the arrow is anchored as a child and added the desired rotation to the arrow component's transform. Then instead of rotating the arrow, the cube is rotated and the arrow rotates with it and is now always pointing towards where the character is facing.
The arrow's direction can be used to determine the forward direction when spawning a projectile, putting something in front of the character, or pretty much anything that needs to know the direction the character is facing.
![]() |
| Always pointing forward. |
The arrow's direction can be used to determine the forward direction when spawning a projectile, putting something in front of the character, or pretty much anything that needs to know the direction the character is facing.
Below is also a video clip demonstrating the whole process above.



