- Home /
How do i change the texture of on object based on its angle relative to another object?
So i want to make a reto 20 shooter where the character has a hand that rotates around his shoulder game and to keep the look of the main character as if it was a single sprite i want to change the texture of the hand each time it rotates 10 degrees aroun the shoulder , because i want it to have a separate colison box , help me please . As in i want 36 sprites that alternate depending on the angle the hand is pointed , how do i do that ?
Answer by iwaldrop · Jul 06, 2017 at 02:49 AM
If you don't want to just rotate a single sprite then you'll need some way of choosing which sprite to show at any given time. Keep in mind that if you did want independant sprites 36 is probably overkill; you can flip on the x and y axis to cut that number down by a factor of 4, then you'd only need to address 9 sprites and flip the axis depending on which target-relative quadrant the pointer is in.
Thanks for the flipping idea , and yes thats what im looking for a way to deter$$anonymous$$ the sprite to show and a way to change it.
Your answer
![](https://koobas.hobune.stream/wayback/20220612125508im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Rotating sprite on mouse drag like clock hand. 0 Answers
Angle of parametric path 1 Answer
Trying to rotate a 2D sprite 2 Answers
TOPDOWN 2D 8 direction sprites vs 1 direction with rotation 1 Answer
Constant Rotation in 2D 0 Answers