playMaker

Author Topic: Input.Touches support  (Read 6433 times)

atmuc

  • Playmaker Newbie
  • *
  • Posts: 26
    • View Profile
Input.Touches support
« on: July 14, 2012, 06:15:18 AM »
https://hutonggames.fogbugz.com/default.asp?W961

this link says i can use input.touches with playmaker. where can i find these custom actions?
« Last Edit: July 31, 2012, 03:37:13 PM by Alex Chouls »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14328
  • Official Playmaker Support
    • View Profile
Re: Input.Touches support
« Reply #1 on: July 16, 2012, 12:04:05 AM »
Hi,

 yes, this is coming. The package has evolved so much that I can't even keep up with the changes, so I am currently revamping my scripts to integrated the latest 1.1.1 which has definitly grown into a much more usable touch input system.

 If input.touches doesn't get updated this week, I'll be able to publish my package so that you can work with it and playmaker.

bye,

 Jean

derkoi

  • Full Member
  • ***
  • Posts: 187
    • View Profile
Re: Input.Touches support
« Reply #2 on: July 21, 2012, 03:16:27 AM »
I just bought Input Touches as I was led to believe it was "Compatible and supported by Playmaker." and I assumed that it was ready to go.  >:(

Any idea when you'll have the package up please?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14328
  • Official Playmaker Support
    • View Profile
Re: Input.Touches support
« Reply #3 on: July 23, 2012, 01:09:51 AM »
Hi,

 We are almost there with this. Input.Touches has still a few small issues to iron out that turn out very important for playmaker integration, for example the current package sends twice events, so that would really cause very buggy and weird behavior in playmaker. As soon as that is updated, I will be in a position to send the package.

If nothing comes up this week, I might just release what I did so far.

bye,

 Jean

derkoi

  • Full Member
  • ***
  • Posts: 187
    • View Profile
Re: Input.Touches support
« Reply #4 on: July 25, 2012, 07:22:49 AM »
Thanks, I'm working with it now.

Any idea how I can use the Angle float to change the direction of my object? I'd like my game object to go in the direction of the swipe rather than left, right, up or down?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14328
  • Official Playmaker Support
    • View Profile
Re: Input.Touches support
« Reply #5 on: July 25, 2012, 08:29:27 AM »
Hi,

 Swipe left, up right and down are my own additions to Input.touches. Simply implement the SWIPE event and use the "Input Touches Get Swipe Info" action to retrieve the angle fo the swipe and use that as the directoin to move your object.


bye,

 Jean

derkoi

  • Full Member
  • ***
  • Posts: 187
    • View Profile
Re: Input.Touches support
« Reply #6 on: July 25, 2012, 10:07:58 AM »
Thanks Jean, I'm unsure how I take the angle float and use it in conjunction with the add torque to roll a ball in the swipe direction, do i need to convert the angle float?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14328
  • Official Playmaker Support
    • View Profile
Re: Input.Touches support
« Reply #7 on: July 26, 2012, 02:09:36 AM »
Hi,

 Ok, will keep taking theoritically for now ( since I don't have time to do a working example for now :) )

Usually I think developers are simply apply a linear force to the ball, but adding torque works just as good.

 to add torque given an angle on screen will require quite a lot of vector math to find the torque axis ( perpendicular to the direction of the swipe). And for this I would not use the angle but the start point and end point of the swipe. so I would define a dummy gameObject that is at the ball position and have it look at the swipe end point and then use that gameObject transform axis to add torque. But in order to do that you will first have to  translate the start and end point from the swipe to 3d position in the world ( likely casting the screen position on the ground plane)

for that, look at this thread: it has a lot in common with what you are willing to achieve
http://hutonggames.com/playmakerforum/index.php?topic=270.msg1092#msg1092

bye,

 Jean

derkoi

  • Full Member
  • ***
  • Posts: 187
    • View Profile
Re: Input.Touches support
« Reply #8 on: July 26, 2012, 02:47:22 AM »
Thanks Jean, I think I'll add force to the ball if it's less hassle. On thinking about it, I think force would be better as it should behave more like the ball is being pushed.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14328
  • Official Playmaker Support
    • View Profile
Re: Input.Touches support
« Reply #9 on: July 26, 2012, 04:52:14 AM »
Hi,

 wel, from a physics point of view, appling a torque from the center of the ball will have the exact same effect as pushing the ball from its center, so no real difference in terms of final behavior, but simply easier to implement I would think out of the blue.

Have a go, and if you get really stuck with no progress, let me know, and I'll do a working example

bye,

 Jean

derkoi

  • Full Member
  • ***
  • Posts: 187
    • View Profile
Re: Input.Touches support
« Reply #10 on: July 26, 2012, 06:18:51 AM »
Thanks Jean. I can't figure it out. Not having a good day.  ::)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14328
  • Official Playmaker Support
    • View Profile
Re: Input.Touches support
« Reply #11 on: July 26, 2012, 07:29:25 AM »
Hi,

 Yes, don't worry, it is indeed something quite advanced, allow few days tho, before I can allocated some time for this. As always, pm me if this is urgent.

bye,

 Jean

derkoi

  • Full Member
  • ***
  • Posts: 187
    • View Profile
Re: Input.Touches support
« Reply #12 on: July 26, 2012, 07:33:15 AM »
Thanks Jean, it is pretty urgent as i'm at a standstill until I can get this sorted.

Can you give me any ideas what Actions I should be using & such to save you some time doing it for me?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14328
  • Official Playmaker Support
    • View Profile
Re: Input.Touches support
« Reply #13 on: July 30, 2012, 12:50:52 AM »
Hi,

 the main source fo study for you is that link I sent you, in there the most important action is mouse3dPlaneDrag

http://hutonggames.com/playmakerforum/index.php?topic=272.msg1087#msg1087

this action will allow you to project a point from the screen to a plan in the 3d world.

in your case: the point on screen will be the starting point and following dragging points. The plan will be parralel to the ground but passing through the center of the ball, then in that plan you will have the start point and the drag directions as a result, you can deduce from that the force to apply as well.

 I'll let you play with this theoritical approach fe wmore days ( mostly because I am very busy :) but this is also because it's good you have a go at it, you will learn a lot more if you struggle a bit with this first, before I give you a working sample).


Bye,
 
Jean

deis

  • Playmaker Newbie
  • *
  • Posts: 1
    • View Profile
Re: Input.Touches support
« Reply #14 on: July 30, 2012, 05:27:30 PM »
Taps do not seem to be working for me with the actions. I can see things like charging and swipes output in the console but taps are not occurring.

UPDATE:
Well I fixed it by adding isMultiTap = MultiTap; to the Start() method inside PlayMakerInputTouchesProxy. Not sure why this was excluded.
« Last Edit: July 30, 2012, 07:19:51 PM by deis »