Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Skaeren on December 09, 2015, 03:10:23 AM

Title: How do I constrain camera position
Post by: Skaeren on December 09, 2015, 03:10:23 AM
The app I am making is 2d, and I was wondering how do I constrain the position of the camera, so that user cannot move it beyond, for example, x 7:-7 and y 4:-4.
Title: Re: How do I constrain camera position
Post by: Skaeren on December 14, 2015, 04:11:54 PM
Kinda sd to see that there has been no response. Is it not possible to do this?
Title: Re: How do I constrain camera position
Post by: phannDOTde on December 14, 2015, 05:02:35 PM
1. Get Cam position
2. clamp the position floats to the desired min max
3. set Cam position

do that in a loop or at every frame and you have your "hard" cam boundarys

Ps.: I guess there is no Vector clamp so you need to use Vector3 get XYZ and Vector3 Set XYZ and then clamp float on both of your axis