[Solved] Detect Player "Camera" position

Status
Not open for further replies.
GetCameraTargetPositionX()
No, you don't need to. The function itself returns asynchronous value, depending on who's machine it's called.
For example, player 1 is currently looking at the exact center of the map. So the function will return "0" for player 1.
At the very same moment, player 2 is looking at different location, so it will return different value for player 2 (not "0").
I hope you get what I mean.
 
So here's the pseudo code:
Code:
    if IsPlayerInForce(GetLocalPlayer(), ThePlayerGroup) and GetCameraPositionX() > RectMinX and GetCameraPositionX() < RectMaxX and GetCameraPositionY() > RectMinY and GetCameraPositionY() < RectMaxY then
        Do whatever here. But do note that everything's done here will be asynchronous. If you are not careful of what you're doing then it will lead you to desync problem.
    endif
 
Status
Not open for further replies.
Back
Top