Move camera with touch

jsorr2jsorr2 Member Posts: 279

I have code set up to move the camera with touch, however it's inverted for some reason. my logic is this:

When touch is pressed in actor as big as scene (1136 x 320)

change attribute -> self.Difference TO game.touches.touch1.X - scene.camera.origin.X

constrain -> scene.camera.origin.x TO game.touches.touch1.x - self.diff

The problem is, the camera moves inverted, but is perfect otherwise. If i swap to self.diff-touch.x the camera moves the way i want it too, however, when touch is pressed again the camera jolts to a new location (if it was at 140, it moves to -140) instead of staying still until touch changes.

Best Answer

Answers

  • jsorr2jsorr2 Member Posts: 279
    edited March 2015

    Thanks for that :)

  • scott.m.rowleyscott.m.rowley Member, PRO Posts: 16

    @Lost_Oasis_Games said:
    See my video on moving the camera with swipe/ touch.

    I clicked on your name to try and find your videos but wasn't able to. Can you tell me where they are located or link to them?

    Thanks

  • DuesDues Member Posts: 1,159
    edited December 2015

    @scott.m.rowley said:

    @Lost_Oasis_Games said:
    See my video on moving the camera with swipe/ touch.

    I clicked on your name to try and find your videos but wasn't able to. Can you tell me where they are located or link to them?

    Thanks

    Here is a link to @Lost_Oasis_Games youtube channel

    Edit: cant get links to work, but search on youtube for Gamesalad Guru

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    The link in my signature that says guru videos.

Sign In or Register to comment.