After the scene quick switched to right, when i touch on the actor, it disappear.
tammywkwong
Member Posts: 10
I make a scene which would quick switch to right when the level was completed. For the right hand side, it is the advance of the preivous game.
The rules in the left hand side of the scene are if touch is press, constrain self.positive.x and y to game.touch.1.x and y, It work fine. But when I make the same rule in the right hand side of scene. Once I touch the actor, it disappear.
What wrong did I did?
https://dropbox.com/s/rov8xy0h1zlmcht/Question.zip?dl=0
Comments
Hi @tammywkwong
your actor has not disappeared, it just moved out of sight to left. Touch returns coordinates relative to the visible part of the scene. It does not account for the camera having moved.
You need to add the camera offset to the touch position if you have a moving camera view.
Here is a video explaining the process:
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
Thanks! Solved