Hey everyone, question here. This is the first time I’ve tried to animate something on the Gui node, and it’s driving me a little mad. I understand why my picture is rotating around the corner, but I can’t figure out how to fix it. I’ve read some related threads, and I know the scene graph like the back of my head, but nothing seems to be working. Here’s a picture to illustrate (the “dial” should be right in the center, but instead it’s doing a circle around the mouse).
I’ve tried rotating the child, rotating the parent node, moving child, moving the parent, but I just have some order mixed up and I’m guessing at this point. If anyone has any ideas, I’d appreciate it! thanks
I don’t know the back of my head … it’s invisible to me most of the time ^^
Simple problem you have:
guiNode → gives you the general parent
nodeItIsAttachedTo → gives you a position in gui space
(Node that you are missing - called a pivot node)
You need another node “pivotNode” and then
pivotNode.setLocalTranslation(pic2.getWidth0.5f, pic2.getHeight0.5f)
I wonder how someone could make such a beautiful gui without ever having stumbled accross this problem… :chimpanzee_closedlaugh: