So I have a widget component attached to an actor, in this case a dropped loot item. Now this has physics enabled so if I run into it and flip it over, the widget will move with the item and end up closer to the ground or to the side of the item rather than on top.
Is there any way I can make the widget component stay on top of the actor, no matter who it is rotated? It is already set to draw to screen rather than world of course.
Try changing the rotation type of the widget’s transform to World:
This should stop the widget component inheriting rotation from the tumbling parent. Never tested it with screen space widgets but it works with the world-space ones.
I’m actually surprised the screen space is affected, tbh!
Sounds reasonable, I’ll have to play around with that. Basically what happened is that I used a standard cube as a placeholder for an item I hadon’t designed yet just to test out some loot mechanics and I flipped a few of them over and the widget indicating the item and the amount followed it around.
Hopefuly this will work, it looks kinda silly right now.
That didn’t actually solve anything… I’ve taken a screenshot to better illustrate what is happening. As you can see, the right item widget has been rotated into the ground as the object rotates, which should not happen.
I’m guessing the issue may be because I’ve set my static mesh to be my root, due to physics simulation. If I were to make it something else, that probably wouldn’t happen.
However, the reason I have set my mesh as my root is that when I enable physics on the mesh, it can detach from the root and so the widget can be on one side of the map while the item is on the other. Even a small movement makes it look terrible.
This is with a widget component set to screen space. It seems to work fine regardless of the static mesh being the root or not. Also, I did not need to change the relative / world rotation as I suggested in my original post (it would be needed if you needed this in world-space). It seems to work out of the box on my end.
Anything else that is unique about the setup you have there?
Yes I was and I was looking for an alternative to have it appear higher, but I just set the Z to 0 instead. Sure it appears kinda on the ground, but it’s fine… I suppose. I’m just a nitpicky ■■■■■■■.
Yesterday I spent hours agonizing over character finger movement.