I’m working on a topdown space shooter game for the mobile device and I need a way
to stop the player ship from moving off the screen.
In the Playership actor(pawn blueprint), “SetActorLocation” is used to move the player location and after that
I use this clamp function to limit the movement, but how do I get it work at the screen edge.
This is what I have so far.
At the moment those are just fixed values (-100,100) for the min and max clamp values, but I’m kinda stuck
on figuring out how to get those clamp values from or depending on the screen size
I have tried several ways like getting the screen size (X & Y)and divide those by half and use it for the
min and max clamp values, but no luck
I have failed trying to get this to work since this week !!