Move to Mouseposition - Doesnt work on iPhone

AlfredchickenAlfredchicken Member, PRO Posts: 11
edited November -1 in Working with GS (Mac)
Hi Everbody :)

I had a little bit trouble with the funktion "move to".

i have an actor. He has a Rule:

"Mousebutton is down" :

Move to:

game.Mouse.Position.X and game.Mouse.Position.Y
Relative to scene

speed blablabla

It perfectly works on my mac. But it won`t on the iphone!? I tried to make touch is pressed, touch1x and all that stuff. But it wont work.

Thxs for your Answer

Comments

  • POMPOM Member Posts: 2,599
    Ok , i suggest you use interpolate instead of move to , cause sometimes 'move to' miss-fire and dont stops at destination , so try something like this :

    create a GAME attribute called "go to position" - boolean - false
    create a GAME attribute called "X position of touch" - real
    create a GAME attribute called "Y position of touch" - real

    make an actor (invisible) and place it all over the screen (480X320)
    inside it make a rule
    "touch is pressed" :

    change - 'Game.X position of touch' to game.touch1.Position.X
    change - 'Game.Y position of touch' to game.touch1.Position.Y
    change - 'Game go to position' to true.

    and in your moving actor:

    WHEN 'Game go to position' is TRUE :

    interpolate ' self.position X' to Game.X position of touch
    'Duration' is your "speed"

    interpolate ' self.position Y' to Game.Y position of touch
    use the same duration as for the X!!

    Then make another rule inside to reset the 'Game go to position' attribute:
    WHEN self.positionX = 'Game.X position of touch'

    change 'Game go to position' to false

    (so it will change to false when it arrives )

    Hope it will help you

    Roy.
  • AlfredchickenAlfredchicken Member, PRO Posts: 11
    thx for your help.

    But i have the same problem :( it moves on my mac, but it wont on my iphone :/

    I made now a "Titlescreen". In this you have to "touch is pressed" -> go next scene. and this works. the problem is not on my phone.

    Hmm :/!
  • AlfredchickenAlfredchicken Member, PRO Posts: 11
    Ok it works. I only had to update my phone -.-

    Please close :)

    Thx to P-O-M :) You are the chief ,)
Sign In or Register to comment.