Having some trouble with multi touch and unique orientations

0 favourites
  • 10 posts
From the Asset Store
Comprehensive localization solution for Construct 3 projects, no addons required!
  • Hey everyone, so I got some amazing help in the past with a project i did that required multi touch and it's worked well with a new project (after some hacking)

    However try this on a touch device and you'll see what i have going on:

    part12studios.com/games/SoapyFun/sf_22

    I still struggle with what's going on sometimes with multi touch. i get it and yet things happen so fast and because it's not possible (that i know of) to simulate true multi touch on a PC/Mac without a touch surface so i have to publis to web and test on phone.. not a terrible workflow but still slower.

    I just want each hand to be it's own unique hand and be oriented to each respective corner (eventually the art will better reflect a full arm, not just a floating hand.. but i can't get that to look right till i get the basic orientation.

    the logic i have right now is using animation name (blue and red) to be what say "if this hand is x animation, point to y coordinate".. it works fine with one hand or the other.. but once one or the other spawns, it seems like something is overriding it. making the 2nd object that spawns to have the same animation name as the other.

    I did a previous attempt to completely create two separate touch objects / hands completely restricting one to be unique from the other but there was still some weird crossover going on that i can't explain.

  • been mulling over this one for a week or so.. just can't seem to crack it.

  • Is this what you are trying to make?

    dropbox.com/s/epsmdrwhpgyacaf/MultitouchDrawing.c3p

  • yes but not "drawing.. i just want a single object (hand) in this case be locked to one box while a second hand is locked within the range of the other.

    The game i did (cyball) was more like a paint function.. i adapted the example from that project to this.. technically i'm "painting" hands but destroying them because i was having trouble figuring out how to draw and pin a single object with the same core logic..

    there is a "left hand" and a "right hand" graphic so the hands differ on the left and right because i'm just flipping to the "red" or "blue" animation..

    but notice how it behaves if you touch on one side.. and then the other side.. the 2nd touched hand gets confused and defaults to the first hands orientation point.. but doesn't do this when it's just one or the other hand.

  • I can't say I understand your explanation.. But you still should be able to use my demo to see how to deal with multitouch. You need to loop through active touches and use Touch.XAt, Touch.YAt

    Another option is touch ID. For example, when a hand sprite is touched, you can save touchID in an instance variable on this hand, and then use touch with this ID to control this hand instance. I utilized this method in an air hockey demo:

    howtoconstructdemos.com/air-hockey-game-template-for-two-players

  • just making sure. you did test with a touch device right? put fingers down on both sides? see what goes wrong? the orientation of the hands are good if you only touch one side or the other.. but if you touch one down (keeping on screen) and then the other one.. the orientation of the 2nd one is off.

  • part12studios See the link to Air Hockey game I posted above. You can control two players with two fingers.

    I don't know what you did wrong in your project. If you want me to fix it, you need to post C3P file, not an exported game.

  • hey there, sorry got caught up with some other stuff.. so no problem, yes i think overall i have it based on the examples i worked with and i've managed i believe to strip it down as easy as possible.. but yea this behavior baffles me but of course it's probably something simple, i just don't see why it would do what it does.. with my limited understanding of the multi touch system. here's the cp3

    dropbox.com/s/2rjhj4x7q9jnnaw/sf_hand_orientation.c3p

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • In events 12 and 13 you need to use condition "Paddle -> Is animation playing". System condition "Compare two values" doesn't pick instances.

    I don't see any other issues.

  • that did it! i thought my condition would work, but i can see how your approach is more active.. i thought it was constantly checking when i would use the kind of comparison i did.

    Thanks!

    Caleb

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