How do i make the camera that follow the player only on y axis?

Hi

I already searched in google, but i don’t found nothing…please help me. Thanks.

Hello @coronasdk96,

Many Corona developers use the 3rd-party “Perspective” library to build camera-like functionality. Most likely you could adjust that code to make the camera follow only on the Y axis:

https://gist.github.com/GymbylCoding/8675733

Take care,

Brent

Level Director also supports camera tracking and based on a user request I modified it to allow you to control tracking in either x or y direction.

If you take a look at the scrolling platform demo and edit the main.lua file you’ll see a line that enables tracking;

myLevel:setCameraFocus(player)

There are two optional parameters to this function, trackX and trackY, so to track the player only on the Y axis you would use this;

myLevel:setCameraFocus(player, false, true) -- only track on Y axis

This might be of some help to you.

Hello @coronasdk96,

Many Corona developers use the 3rd-party “Perspective” library to build camera-like functionality. Most likely you could adjust that code to make the camera follow only on the Y axis:

https://gist.github.com/GymbylCoding/8675733

Take care,

Brent

Level Director also supports camera tracking and based on a user request I modified it to allow you to control tracking in either x or y direction.

If you take a look at the scrolling platform demo and edit the main.lua file you’ll see a line that enables tracking;

myLevel:setCameraFocus(player)

There are two optional parameters to this function, trackX and trackY, so to track the player only on the Y axis you would use this;

myLevel:setCameraFocus(player, false, true) -- only track on Y axis

This might be of some help to you.