Position Listener

I need the listener to do specific actions when the object being listened have reached certain height. How do I do that?

I tried creating a y-axis line physics object, the listener activates when my object and this line collided, but law of physics messed things up…

Hi @allrpglover,

Please post some code so the staff/community can help you. If possible, show this code in the most simple form, without using any Composer scene structure, external modules/functions, etc.

Also, please surround your code in “lua” tags so it’s easier to read.

[lua] ... [/lua]

Best regards,

Brent

Use an enterFrame listener. Inside the listener, check the object’s y coordinate, and act accordingly.

See http://docs.coronalabs.com/api/event/enterFrame/index.html

Hi @allrpglover,

Please post some code so the staff/community can help you. If possible, show this code in the most simple form, without using any Composer scene structure, external modules/functions, etc.

Also, please surround your code in “lua” tags so it’s easier to read.

[lua] ... [/lua]

Best regards,

Brent

Use an enterFrame listener. Inside the listener, check the object’s y coordinate, and act accordingly.

See http://docs.coronalabs.com/api/event/enterFrame/index.html