#Anyone knows why trying to project an

1 messages · Page 1 of 1 (latest)

obsidian shoal
#

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?

honest summit
#

Probably not

chilly portal
#

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 👍

obsidian shoal
#

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.

chilly portal
#

That’s a solid hypothesis, I might take a peak cause now I’m curious ahah

obsidian shoal
#

I'm truly sorry for making you interested in this lol

spiral blade
#

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

honest summit
#

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

spiral blade
#

TLDR; widgets are ui elements that exist on the hud, and the hud is for a specific player

honest summit
#

This has nothing to do with Widgets...

#

Or the HUD fwiw.

spiral blade
#

I mean, hes projecting world to screen and then setting a widgets position

honest summit
#

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.

spiral blade
#

Doesn't matter, im explaining why he needs a player for what hes doing.

obsidian shoal
#

That is a interesting insight @honest summit, thank you for the explanation!

honest summit
#

I mean it matters if what you explain is irrelevant to the requirement of the controller..

spiral blade
#

the controller IS a player .. screen space is really 'viewport space' and is also per player

#

anyway do you not see the node hes using "project world location to widget position'?