#Anyone knows why trying to project an
1 messages · Page 1 of 1 (latest)
Alright, plugging the Player controller gave me the correct screen position.
Is there a way to get an actor screen position without the player controller?
Probably not
Would have to dig into the C++ of the node to figure out why it needs the player controller. But the node seems to be designed that way so best to follow the design 👍
Will do! I just wanted to know why it needed the controller 🤔 .
Perhaps it has to do with the player controller owning the HUD.
Anyways, thank you both for your time.
That’s a solid hypothesis, I might take a peak cause now I’m curious ahah
I'm truly sorry for making you interested in this lol
You should be handling the bool return value of the project calls.
if the actor is in fact not on screen, it will be false
and most likely in that case, the screen position value would be 0,0
also, you are not putting anything into the Player and PlayerController pins
The reason it needs the PlayerController is that internally the functionality sits on the ULocalPlayer.
And to get your hands on that you need a PlayerController. And since you can have Splitscreen, you are required to pass in the PlayerController you wish to deproject the location for.
Or well, not the whole functionality, but the information, like the Viewport.
The ULocalPlayer basically provides the ProjectionData for the Player that is then used to actually project the location to the screen via FSceneView::ProjectWorldToScreen
TLDR; widgets are ui elements that exist on the hud, and the hud is for a specific player
He already figured that out.
This has nothing to do with Widgets...
Or the HUD fwiw.
I mean, hes projecting world to screen and then setting a widgets position
Yeah, but the node has nothing to do with Widgets
The Node needs the PlayerController to get the ULocalPlayer to get the ProjectionData for that Player.
Doesn't matter, im explaining why he needs a player for what hes doing.
That is a interesting insight @honest summit, thank you for the explanation!
I mean it matters if what you explain is irrelevant to the requirement of the controller..