Touch to move

klickinkklickink Member Posts: 35

All I want to do is touch the screen and have my actor move toward that point. If you stop touching the actor will stop or if the actor reaches the point it will also stop. I have messed around with the "move to" function and that never works the way I want it to and the "accelerate to" function is to harsh and just not what I want. I started to see if I could get it to work with "interpolate" however I can only make it move to exactly where I touched. Has anyone come up with a method for touch to move in a specific at a predetermined speed for as long as your mouse/finger is down and to stop the second you reach that point/let go.

Comments

  • SocksSocks London, UK.Member Posts: 12,822

    I'd just use when mouse button is down Move To mouse X, mouse Y.

  • klickinkklickink Member Posts: 35

    @Socks thank you for responding and your right that works on the new project I have just started as a test build. I had already tried that and it didn't work. I believe my problem is that fact that my scene is 3000/1400 and I think it is messing with something because the actor doesn't respond in the same way when I place it on the bigger scene.

  • SocksSocks London, UK.Member Posts: 12,822

    @klickink said:
    . . . my problem is that fact that my scene is 3000/1400 . . .

    When mouse button is down Move To mouse X + camera origin X, mouse Y + camera origin Y

  • IceboxIcebox Member Posts: 1,485

    @klickink Im not sure if this is what you want , or if its the right way to do it , when you touch on the screen the actor will move to the position and if you let go it will stop , hope this helps

  • klickinkklickink Member Posts: 35

    @socks thank you so much that works perfectly. This has been frustrating me for 2 hours now and I just couldn't figure it out.

  • klickinkklickink Member Posts: 35

    @Icebox1910 thank you your project worked and I would have implemented it had the other method not worked.

  • IceboxIcebox Member Posts: 1,485

    @klickink im glad you solved it , yea the other method is better :D good luck with your game

  • SocksSocks London, UK.Member Posts: 12,822

    @klickink said:
    socks thank you so much that works perfectly. This has been frustrating me for 2 hours now and I just couldn't figure it out.

    Think of it like this, you have a scene, it's (for example) 1024x768, when you reference a position within that scene you are referencing it in relation to the lower lefthand corner (0,0) of the scene, but when you move the camera to some other place, let's say 10,000 pixels along a large scene, the reference point (the lower lefthand side of your scene and not your camera view) is still way back at 0,0 ! So you need to bring the 0,0 reference point along with you, a quick way is to reference the lower lefthand side of the camera instead of the lower lefthand side of the scene. Hope that makes sense !!

Sign In or Register to comment.