I create a UWidgetComponent inside of the AActor class inheritance but it does not demonstrate in the screen when I start the gameplay, but if I create the widget from the UE5 Editor instead of using C++ it demonstrate on the screen. What the problem I really don’t get it.
Anyone can help me the solve this problem? Or any different perspective to find out the solution?
.h
class ABaseBuilding:: public AActor,
....
UWidgetComponent* OptionsMenuWidget;
...
My problem is not editing the widget. The main problem is when I attach the widgetclass, it does not demonstrate inside of AActor. But it demonstra inside of ACharacter in gameplay.
Widget inside of the AActor demonstrate when I editting. But it’s not inside the gameplay.
I just tested an Actor with your code and it worked.
I don’t know what is happening but make sure the Actor ( or component ) is facing the camera and at a valid distance.
Because if I demonstrate as World, I can see the widget FVector(0,0,100 ) on correct perspective of camera. But I can’t see as screen method at nowhere.
Even switching to ‘Screen’ I can still see the Widget, regardless of whether it is sideways or backwards in this case, but it needs to be in front of the camera.
Try with different Draw Sizes. I don’t know what could be happening.
By Gameplay you mean Play in Editor?
PS: In the case of Space = World: I see the Widget in the Editor’s level AND when I click Play.
In the case of Space = Screen: I only see the Widget when I click Play.
The widget in editor looking like this, There is too many distance between widget and the Actor.
The Widget at FVector(0,0,0) in World Location ( I did not edited like that, it’s default I dont know why )
The widget edited in editor like this. It is really annoying because I totally locked up. I can’t go further and did not getting the problem.