Hi, I’m trying to learn how to have an NPC have a random text greeting when clicked on within a certain range.
I’ve gotten the range part down with the BoxTrigger, but I’m having trouble having a DrawText function float above the NPC ( In this case a circle.) I’ve tried a bunch of different ways to try to get it to work, but it just wont appear on the screen.
You want to use the Project node on the actor’s location. Right now you are feeding the actor’s world X and Y coords into screen space, which will not be where you want it to be. The Project node will convert the actor’s world location vector into a 2D screen space vector, which you can then feed into Draw Text’s X and Y locations. You may have to adjust the location slightly (adding/subtracting from X and Y) to get it to be above the actor, rather than on top of it.
Two possibilities I can think of right now:
Is this connected to the Event ReceiveDrawHUD?
Is your GameMode blueprint set up to use your custom HUD class?