Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: atmuc on July 14, 2012, 09: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?
-
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
-
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?
-
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
-
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?
-
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
-
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?
-
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 (http://hutonggames.com/playmakerforum/index.php?topic=270.msg1092#msg1092)
bye,
Jean
-
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.
-
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
-
Thanks Jean. I can't figure it out. Not having a good day. ::)
-
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
-
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?
-
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 (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
-
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.
-
Thanks Deis, I noticed that but I didn't have the time to look at it yet.
-
Hi,
Well spotted! thanks for that.
Please find the updated package on the wiki.
bye,
Jean
-
thanks deis. it solved my problem. is there any action for input touches to catch taps just for owner object? like mouse pick event.
-
Hi,
It's not built in Input.touches unfortunatly, so you'll have to do your object detection yourself for now. I haven't done any work on that with Input.touches, my main goal was to make it available to playmaker, and yes, it is quite limiting that you can't really have a convenient way to access picked object or have some system to make it convenient.
Maybe in the future, I could wrap something up.
bye,
Jean
-
may I ask,
SHORT TAP event is globally, which is the best way to know one gameobject is touched ?
thanks alot.
-
Hi,
When you catch a SHORT TAP get the tap position and ray cast for it, and then you can find the object underneath the touch.
bye,
Jean
-
Hello,
I use "Unity3d 4.1.2" , "Input.Touches 1.1.1" and "Input.touches Custom Actions" for "Playmaker 1.5.7" https://hutonggames.fogbugz.com/default.asp?W961
When i try to import "Input.Touches Custom Actions" i see this:
(http://img13.imageshack.us/img13/8674/touchp.jpg) (http://imageshack.us/photo/my-images/13/touchp.jpg/)
How i can fix this?
Thanks!
-
Hi,
You need to have the latest Input touch package and the latest set of custom actions as well. Can you double check you are all up to date on that front? What version of input touch do you have currently?
Bye,
Jean