Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Making widget component stay above rotating actor?


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.

Product Version: UE 4.21
more ▼

asked Feb 16 '19 at 06:42 PM in Using UE4

avatar image

Crowley Caine
683 8 9 15

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Try changing the rotation type of the widget's transform to World:

alt text

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!

untitled.png (17.9 kB)
more ▼

answered Feb 16 '19 at 11:54 PM

avatar image

14.6k 76 25 61

avatar image Crowley Caine Feb 16 '19 at 11:57 PM

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.

avatar image Everynone Feb 17 '19 at 12:01 AM

I did something like this last year. Can't access old gyazo gifs to demonstrate :| But here is an atrocious quality mini thumb:


avatar image Crowley Caine Feb 17 '19 at 08:11 AM

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.

alt text

widgetrotation.png (445.3 kB)
avatar image Everynone Feb 17 '19 at 08:27 AM

Is this what you're after:

Image from Gyazo

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?

edit: just to confirm:

alt text

capture.png (11.6 kB)
avatar image Crowley Caine Feb 17 '19 at 08:27 AM

Yes precisely.

avatar image Everynone Feb 17 '19 at 08:35 AM

Added more info.

avatar image Crowley Caine Feb 17 '19 at 08:37 AM

Not really.

alt text

actor1.png (9.0 kB)
avatar image Everynone Feb 17 '19 at 08:38 AM

I think you're using a Z offset for the widget component.

avatar image Crowley Caine Feb 17 '19 at 08:43 AM

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 bastard.

Yesterday I spent hours agonizing over character finger movement.

avatar image Everynone Feb 17 '19 at 08:46 AM

alt text

For starters, set pivot Y to 1 (so the root of the widget is at its bottom) and/or increase the DrawSize Y.

You could also alter the widget itself, and give it some bottom padding.

capture.png (19.3 kB)
avatar image Crowley Caine Feb 17 '19 at 08:49 AM

Yeah I tuned it to 1,5 and it appears as it was now. Thanks a lot.

But upon closer examination I decided that having it lower would actually be more helpful to the player.

alt text

avatar image Everynone Feb 17 '19 at 08:53 AM

Oh yeah, that looks about right! Good luck with the rest.

avatar image Crowley Caine Feb 17 '19 at 08:56 AM

Thank buddy, this was really helpful!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question