I created a widget with an image of an arrow. This arrow is supposed to point in the direction of the player’s movement. It is doing this, but instead of just spinning around, it also moves around the screen in a circle as if orbiting the center of the screen. When I open up the widget and adjust the angle there, it works as expected and just spins around at the desired location. When I feed a number into the “Set Render Transform Angle” at runtime, it points in the right direction but again, seems to adopt the center of the viewscreen as it pivot point. I have tried different anchors, and that does nothing. I have tried setting different pivots, and that doesnt help, again it works right until runtime.
Here is what it does at runtime. The arrow is pointing in the desired direction. The green circle indicates the desired location. The red circle indicates the locations the arrow actually goes to as it orbits the center of the screen. Again, in the widget, when the angle is adjusted it stays in the correct position. So, finally, any ideas why it orbits the center of the screen at runtime? How can I get it to stay at the desired location?
I’ll also note here that I had been anchoring it bottom left, as I was grouping it with some other widgets down there. I tried a few different anchors just to be sure and hadn’t switched it back before I took the screenshot.
Okay, I solved it. I was rotating the entire widget. What I needed to do was get a reference to the image, and rotate the image itself.