playMaker

Author Topic: 2D Camera Follow  (Read 6226 times)

Stanimation

  • Playmaker Newbie
  • *
  • Posts: 5
2D Camera Follow
« on: October 28, 2012, 02:38:52 PM »
Hey All! First post for me. I'm an extreme newbie. So apologies if this has been addressed. I'm doing a side-scroller 2d type of game. I cant figure out how to have the camera follow the animating object, as the object approches the edge of the field of view. As an example, imagine a stick-man running left or right. As stick-man gets close to the egde of frame, the camera starts to follow. If the stick-man reverses direction, the camera stops and waits until it gets close to the other edge before following again. Seems easy enough! Ha! I have been battling this for days. Currently i just have the camera parented to the object. But as you can imagine, that sucks. Thanks for any and all help on this one.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15563
  • Official Playmaker Support
Re: 2D Camera Follow
« Reply #1 on: October 29, 2012, 01:42:32 AM »
Hi,

 I have done just this, and you can find a working sample here:
https://hutonggames.fogbugz.com/default.asp?W890

here it scrolls vertically, but really it's the same principle.

If you have questions, let me know.

bye,

 Jean

Stanimation

  • Playmaker Newbie
  • *
  • Posts: 5
Re: 2D Camera Follow
« Reply #2 on: October 29, 2012, 11:00:06 PM »
@jeanfabre

Thank you so much. I will give this a try this evening! :)