playMaker

Author Topic: 2D point and click?  (Read 1956 times)

marlenesh

  • Playmaker Newbie
  • *
  • Posts: 3
2D point and click?
« on: November 16, 2014, 02:47:26 PM »
Hi!
Me and a couple of friends of mine are making a small sidescrolling 2D "point and click"-game in unity with Playmaker, and met som trouble on our way. We are all total newbies, and dont have any background with programming, so it's quite a struggle, haha  :)

We've been able to make the character move by clicking, and made the camera to follow, but we want to lock the camera to only move on the X-axis (right now it's also moving on the y-axis when the character jumps). We also want the camera to stop when it's getting near the edges. Anyone having any ideas how we can solve this? :)

- Marlene

marlenesh

  • Playmaker Newbie
  • *
  • Posts: 3
Re: 2D point and click?
« Reply #1 on: November 16, 2014, 03:40:20 PM »
OK, I found out how to make the camera only follow the character on the X-axis, now I just need to make it stop at the edges :)

cloud03

  • Full Member
  • ***
  • Posts: 249
  • Viva Playmaker!
    • Milkish Game Studios Blog
Re: 2D point and click?
« Reply #2 on: November 16, 2014, 08:25:32 PM »
well you can constantly check for the character pos on X-axis, and create two states for the camera, one for the action that follows the character, and one for stop, on those 2 states, constantly check the character x position, if it reach a certain pos then go to another state (which is stop), but when the character x position are less or more than that certain pos (depends on the left side of the edge or the right side), go back to the following state...