Download

Camera Smart Edge Panning without detach

I’m trying to replicate the camera function of Battlerite, the camera is locked to the player, but when you move the mose closer to the edge of the screen, the camera moves quite a bit to show you what you would not be able to see if it was in the center of the screen.

I’m still learning how to use the engine and it’s proving really difficult because it’s not as user friendly as I thought, doesn’t help either that I come from an RPA background with VB.Net knowledge :P.

I’ve tried creating “boxes” made of pixels on the edges on my screen, but from there I am clueless onto how to offset the top-down camera into the direction of the mouse and back to the original position, I probably don’t even need those boxes in the first place, but I can’t figure out how to calculate the distance from my character to the cursor, or alternatively, take the center of the viewport as my starting point, then find the angle that the cursor is at in correlation with that point, I believe if I can figure out the angle at which the cursor is situated at in relation to the center of the viewport and the distance from this point is the solution to half of the issue, the other is offsetting the camera by a certain value in the angle of that direction based on World Location (I think World is relevant here?).

Can anyone please help?