I’m trying to project a 3D position of my Actor to screen 2D position using ProjectWorldLocationToScreen() in Top-Down template. It works fine when the Actor is on screen, but when I move Camera far away from him, it returns false (Camera moves independently). The function doesn’t stop working when Actor is off the screen, just behind screen edge. It stops when the Camera is far away from his position.
Why it works like this? I can’t project Actor position if he is off the screen?
// Get the first Player Controller from World APlayerController *PlayerController = (WorldContextObject ? UGameplayStatics::GetPlayerController(WorldContextObject, 0) : NULL); // Get screen position of the world position bool success = PlayerController->ProjectWorldLocationToScreen(worldPosition, *screenPosition);