Tap-To-Move Touch Controls non-responsive

0 favourites
  • 3 posts
From the Asset Store
This kit will show you how to position GUI elements based on screen size
  • IMAGE REFERENCE: dropbox.com/s/c4vzxdxw2rxft0q/Touch%20Mobile%20Controls.png

    As you can see from the image, I'm working to make a character move via the Pathfinding behavior.

    HOW IT SHOULD WORK

    1. Player touches screen designated by the BusterMoveVerify object. (This is because a portion of the screen is dedicated to the HUD where specific controls are. I don't want Buster (the character) moving any time that area is tapped, after all.)

    2. The coordinates of that particular touch are stored to the character. (The animation frame is just part of my test to verify what's working and what's not.) The ID # of that touch is stored, as well. The IsInTouch boolean is to make sure simultaneous touches don't occur in the designated (non-HUD) screen area.

    3. Upon releasing the touch, the character should find the path to the coordinates of the touch. Also, the IsInTouch boolean will be set to false so that another touch can properly register and the touch ID variable also reset so that there's hopefully no further bugs...

    THE PROBLEM

    I've verified that the initial touch does work (that's the purpose of the animation frame action). The BusterOnTouchX/Y variables receive the coordinate values of the touch and the IsInTouch boolean also updates to true. However, whether I'm using my mouse, the touch screen on my laptop, or live previewing on my cell phone (the game is ultimately going to be a mobile app), it never recognizes the end of the touch.

    Since I'm using Pathfinding, I've checked to make sure there's no issue with the cells - plenty of space to move around in so not to hinder its finding a path or moving along it. But, it doesn't even FIND a path to the touch coordinates.

    I'm at a loss here. Could someone wiser than I am help me, please? THANK YOU!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You are using "On Nth touch end". N here is not touch ID, it's the index! For example, if 3 fingers are touching the screen and you lift one finger, "On 2nd touch end" will be triggered.

    In your case you need "On any touch end" and then compare touch ID.

    Or simply use "On tap AreaSprite -> Buster Find path to (touch.x, touch.y)". That's it, just one one event, no need to deal with all those variables!

  • Well, that did it. You were right - just one event. Leave it to me to make things more difficult than need be. LOL

    Thank you for your help!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)