Playmaker Forum

PlayMaker Help & Tips => iOS Help => Topic started by: Stanimation on October 28, 2012, 02:38:52 PM

Title: 2D Camera Follow
Post by: Stanimation 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.
Title: Re: 2D Camera Follow
Post by: jeanfabre 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 (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
Title: Re: 2D Camera Follow
Post by: Stanimation on October 29, 2012, 11:00:06 PM
@jeanfabre

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