playMaker

Author Topic: Tap to rotate?  (Read 3963 times)

HeathClose

  • Full Member
  • ***
  • Posts: 226
Tap to rotate?
« on: March 12, 2017, 01:56:54 PM »
I've been doing a lot of search and just can't find an answer... there was one that came close but I think it was only for nGUI...

I just want to rotate an object when I touch the screen..

I tried mouse down and mouse up system events... but it sees both on mouse up only... I've tired get mouse button down / get mouse button up... that didn't seem to work at all either way...

I was changing the ugui component proxy in the inspector along the way with these changes...

I tried on gui click... but that only sees the click on the mouse up and not down... i have it working if you click it itween rotates by a certain degree... but...

how do I tap the screen... rotate an object while my finger or mouse is down... and then when I let up.. the rotation stops?

This seems like a very simple undertaking... but I can't figure out why I can't get any solution to work...
« Last Edit: March 12, 2017, 02:24:55 PM by HeathClose »

pXd

  • Playmaker Newbie
  • *
  • Posts: 29
Re: Tap to rotate?
« Reply #1 on: March 12, 2017, 07:18:54 PM »
Have you tried "Touch Event" ??

pXd

  • Playmaker Newbie
  • *
  • Posts: 29
Re: Tap to rotate?
« Reply #2 on: March 12, 2017, 11:36:33 PM »
Here's an untested example FSM. Hope it helps.

Cheers.


HeathClose

  • Full Member
  • ***
  • Posts: 226
Re: Tap to rotate?
« Reply #3 on: March 13, 2017, 11:18:39 AM »
Here's an untested example FSM. Hope it helps.

Cheers.
I tried this.. but nothing happens... I tried this both on the object that rotates and the button with a uGui on click.. how do I use this?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Tap to rotate?
« Reply #4 on: March 13, 2017, 01:22:43 PM »
Hi,

 uGui only works if there is a UI element under the touch, so one way is to make a UI panel that fits the while screen, then uGui is going to work.

 Else, you'll simply need to use MOUSE DOWN and MOUSE UP system events, it works for the first touch and emulates a mouse button basically.


 Bye,

 Jean

HeathClose

  • Full Member
  • ***
  • Posts: 226
Re: Tap to rotate?
« Reply #5 on: March 13, 2017, 07:56:24 PM »
Hi,

 uGui only works if there is a UI element under the touch, so one way is to make a UI panel that fits the while screen, then uGui is going to work.

 Else, you'll simply need to use MOUSE DOWN and MOUSE UP system events, it works for the first touch and emulates a mouse button basically.


 Bye,

 Jean

as I mentioned in the op, mouse down is only see on the upstroke...

I have a gui button with a proxy on it... as I mentioned... this will rotate the itween by an amount... but that's not what I need to achieve.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Tap to rotate?
« Reply #6 on: March 15, 2017, 09:18:58 AM »
Hi,

 Touch is properly emulated with a mouse down and mouse up system event, it's just that I think you forgot that it only works if the touch is above a collider or trigger.

so at this point I would suggest another approach. the best and simple touch system I know and use for cases like yours is Input.touches, and I ported it to PlayMaker fully, so if you are ok with spending a few bucks I would suggest this.

https://hutonggames.fogbugz.com/default.asp?W961
https://www.assetstore.unity3d.com/en/#!/content/3283

Also for a more complex powerful solution, there is also EasyTouch with official support of PlayMaker built in:

https://www.assetstore.unity3d.com/en/#!/content/3322


Bye,

 Jean

HeathClose

  • Full Member
  • ***
  • Posts: 226
Re: Tap to rotate?
« Reply #7 on: March 16, 2017, 09:03:50 AM »
Hi,

 Touch is properly emulated with a mouse down and mouse up system event, it's just that I think you forgot that it only works if the touch is above a collider or trigger.

so at this point I would suggest another approach. the best and simple touch system I know and use for cases like yours is Input.touches, and I ported it to PlayMaker fully, so if you are ok with spending a few bucks I would suggest this.

https://hutonggames.fogbugz.com/default.asp?W961
https://www.assetstore.unity3d.com/en/#!/content/3283

Also for a more complex powerful solution, there is also EasyTouch with official support of PlayMaker built in:

https://www.assetstore.unity3d.com/en/#!/content/3322


Bye,

 Jean

thank you Jean, I'll have a look  :)

HeathClose

  • Full Member
  • ***
  • Posts: 226
Re: Tap to rotate?
« Reply #8 on: March 22, 2017, 06:59:20 PM »
Hi,

 Touch is properly emulated with a mouse down and mouse up system event, it's just that I think you forgot that it only works if the touch is above a collider or trigger.

so at this point I would suggest another approach. the best and simple touch system I know and use for cases like yours is Input.touches, and I ported it to PlayMaker fully, so if you are ok with spending a few bucks I would suggest this.

https://hutonggames.fogbugz.com/default.asp?W961
https://www.assetstore.unity3d.com/en/#!/content/3283

Also for a more complex powerful solution, there is also EasyTouch with official support of PlayMaker built in:

https://www.assetstore.unity3d.com/en/#!/content/3322


Bye,

 Jean

do you use easy touch?

i purchased easy touch... and I added a global transition on a button





I have the easy touch proxy in the scene... but this doesn't work.. and the documentation isn't clear... and I can't find any tutorials...

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Tap to rotate?
« Reply #9 on: March 23, 2017, 02:01:49 AM »
hi,

- there should be a demo. Have you checked?
- does your object have a collider?

Else, I'll have a look, but, yes, I know EasyTouch Author, he's french too, I helped along the development of the PlayMaker support, so it is definitly working :) but needs a learning curve probably to understand easytouch and then the PlayMaker support.

 Bye,

 Jean

HeathClose

  • Full Member
  • ***
  • Posts: 226
Re: Tap to rotate?
« Reply #10 on: March 23, 2017, 08:55:07 AM »
hi,

- there should be a demo. Have you checked?
- does your object have a collider?

Else, I'll have a look, but, yes, I know EasyTouch Author, he's french too, I helped along the development of the PlayMaker support, so it is definitly working :) but needs a learning curve probably to understand easytouch and then the PlayMaker support.

 Bye,

 Jean

I'm not trying to touch an object... I have a gui button with no image covering the whole screen... I just want to rotate an object when I touch the screen and stop rotating when I let go... that's all I want to do through this whole thread

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Tap to rotate?
« Reply #11 on: March 24, 2017, 02:23:56 AM »
Hi,

 yes :) I am with you but Ui event system is very different than regular colliders, they don't work together de facto.

 I'll check on easytouch handle Unity UI, plaase ping me mid next week if I haven't got back to you on this :)


 Bye,

 Jean

HeathClose

  • Full Member
  • ***
  • Posts: 226
Re: Tap to rotate?
« Reply #12 on: March 24, 2017, 09:20:19 AM »
Hi,

 yes :) I am with you but Ui event system is very different than regular colliders, they don't work together de facto.

 I'll check on easytouch handle Unity UI, plaase ping me mid next week if I haven't got back to you on this :)


 Bye,

 Jean

thanks for the help, I appreciate your attention

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Tap to rotate?
« Reply #13 on: April 03, 2017, 07:34:30 AM »
Hi,

 ok, so yes, it's all there and working.

- you need the EasyTouchScene proxy on an empty gameobject
- you need the easytouchObjectProxy on an empty gameObject you want to catch the touch event with
- use the global event "EASYTOUCH / SCENE / ON_SIMPLETAP"

and this even will be called whenever you tap, regardless of the scene content.

let me know if you still struggle with this.

Bye,

 Jean