# playMaker

#### profil84

• Playmaker Newbie
• Posts: 7
« on: February 24, 2016, 05:54:51 PM »
Hello,
I'm hitting the wall...all i got is like Advance wars setup, got terrain, mouse controlled camera movement (after left mouse button down) but my camera move out of terrain i want to present, dont know how to achieve so camera stop at the edges of terrain like in advance wars.
Anyone willing to help, it is even possible in Playmaker?

#### profil84

• Playmaker Newbie
• Posts: 7
« Reply #1 on: February 25, 2016, 05:42:26 AM »
Anyone can help?
I try to Get vector3, set vector 3, and clamp the position.....not working at all.
Any hint, suggestion where to start?

#### profil84

• Playmaker Newbie
• Posts: 7
« Reply #2 on: February 25, 2016, 08:38:23 AM »
I try to make edge colliders on Terrain sprite and rigidbody on camera but when i move camera with move stronger it fly through the edge colliders.....omg, dont know making that "basic" camera in Unity/Playmaker is like doing weird magic

#### jasperPT

• Full Member
• Posts: 110
• I am a VFX Animator teaching myself to make games
« Reply #3 on: February 25, 2016, 09:11:13 AM »
Try setting up a few vector 3 variables with the x/y of your boundaries
clamp your camera every frame with these values.
If it is just a square space this should be quite simple.

#### profil84

• Playmaker Newbie
• Posts: 7
« Reply #4 on: February 25, 2016, 10:51:00 AM »
Try setting up a few vector 3 variables with the x/y of your boundaries
clamp your camera every frame with these values.
If it is just a square space this should be quite simple.

Yes, this is for square space (sprite,which is my terrain).
I set up Get Vector3 XYZ in FSM on my Sprite(terrain) to get vector3 in variable and make that x,y in floats global variable. Then in Camera FSM i add Float clamp
and set up as on screenshot.
My logic is that GetVector make vector3 (sprite size) into floats and then clamp action on camera convert those clamp into boundrys to limit camera movement but i think my logic fail....

#### profil84

• Playmaker Newbie
• Posts: 7
« Reply #5 on: February 25, 2016, 05:15:13 PM »
Is this right path? I put some screenshots in previous post with FSM and still trying to figure this out in a way JasperPT told me but i definitely do something wrong i watch all tutorials about cameras and dont see anything about making bounds for camera, basic stuff when it comes to camera functionality but seems imposible for me, some more help based on what i achieved so far will be greatly appreciated.

#### profil84

• Playmaker Newbie
• Posts: 7