How to get the 2D screen location of a 3D Actor?

Every Actor has a 3D location in the game world. And after projection, Actors are rendered in the 2D screen space. If i had the 3D transform of a Actor, how can i get its 2D location of my screen?

The situation is: i want to make a missile locking on system. And when player locks an enemy in 3D world, i want to draw a cycle or something surrounding it in the HUD to tell the player that you are locking that ship. But, if you want to draw a icon in HUD, you need a 2D location of the Canvas. And how can i transmit the 3D location to my 2D screen location? I really stuck here…

Thank you for helping me, and i apologize for my poor English…

Take a look at UGameplayStatics::ProjectWorldToScreen().
Should do what you need.

1 Like

Got it! I’m trying this!

Hello, very disturbing, have you solved this problem?