playMaker

Author Topic: Gameobject follow finger/touch help  (Read 2984 times)

blazingriver

  • Playmaker Newbie
  • *
  • Posts: 26
Gameobject follow finger/touch help
« on: May 25, 2015, 05:08:56 AM »
Hi,
In my current project, I am creating a game which uses a joystick input system and also a tapping system. As the two systems must not interact (i.e. a tap must not trigger the joystick), I have created a transparent game object to serve as the touch sensitive region for the joystick. However, I am having a number of problems.

First of all, what I am trying to create is a floating joystick, which only appears when the touch sensitive region is tapped. I have achieved this, and when a user taps in the region, both the joystick (the inner circle) and it's housing (the outer circle) are created (see attachment).

However, the first problem I have is that when the finger is lifted of the device, the joystick is not destroyed. I have attached a screenshot of the FSM that I have used to try to achieve that.

Also, I am trying to make it so that the joystick (the innercircle) moves to the finger position of the user, as they drag it, to give a joystick like affect. Then from here, the angle would be calculated between the initial tap position, where the joystick housing spawned, and the finger position (the location of the finger is). However, I haven't been able to get this working.What would be the best way to achieve this effect in an FSM?

My last problem is that even if I get the joystick to follow the finger's position, as multiple fingers would be in contact with the screen at once, how would I make it so that the joystick only follows the finger which it was initially tapped with (the thumb), so it will ignore any other fingers?

Alternatively, does anyone know or would recommend any joystick assets on the asset store which are compatible with playmaker?

Thank you in advance.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Gameobject follow finger/touch help
« Reply #1 on: May 25, 2015, 10:09:46 AM »
Hi,

 this is a good question and a typical issue.

 I assume you are using Untiy 4.6 and the new UI system right? I'll make a sample on the ecosystem showing this.

as for joystick assets, I haven't used any yet, maybe someone can step in with some experience on this.

 Bye,

 Jean

blazingriver

  • Playmaker Newbie
  • *
  • Posts: 26
Re: Gameobject follow finger/touch help
« Reply #2 on: May 25, 2015, 12:37:04 PM »
Thank you for your reply. Also, I'm using Unity 5, but I assume that it would also be applicable in this version (even if it's not, I have 4.6 on another computer anyway).

Thanks.