Playmaker Forum

PlayMaker Help & Tips => iOS Help => Topic started by: meaphly on May 05, 2011, 09:30:40 PM

Title: Creating dual pad controls only using PlayMaker
Post by: meaphly on May 05, 2011, 09:30:40 PM
Hi,
    I am totally new and amazed by PlayMaker and would like to ask a question so I don't have to reinvent the wheel :)
Is it possible to create a dual pad control system for iOS using only PlayMaker and no other scripts?

Thanks in advance!
Title: Re: Creating dual pad controls only using PlayMaker
Post by: Alex Chouls on May 08, 2011, 03:56:50 AM
You should be able to build one using Touch Event, Get Touch Info and some Math actions. However, this is on the list of built-in mobile actions that I'd love to have in Playmaker soon (e.g., TouchJoystick, DrawPath, DragSelection...).

If you tackle it as an FSM, I'd recommend an FSM for each joystick.

Also came across this useful reference (I plan to use it for the TouchJoystick action):
http://www.gamasutra.com/view/feature/6323/a_guide_to_ios_twin_stick_shooter_.php
Title: Re: Creating dual pad controls only using PlayMaker
Post by: henk on July 11, 2011, 09:11:04 PM
This would be very useful. Should I look on this thread for an announcement when you've got this done?
Title: Re: Creating dual pad controls only using PlayMaker
Post by: gamedivision on December 05, 2011, 03:46:26 PM
i really would love this,does anyone have any tutorials on creating a joystick with buttons

thanks
Title: Re: Creating dual pad controls only using PlayMaker
Post by: Lars Steenhoff on March 07, 2012, 06:13:45 PM
Any ETA when this will be ready? Thanks  :)
Title: Re: Creating dual pad controls only using PlayMaker
Post by: Alex Chouls on March 07, 2012, 11:37:40 PM
I'll try to prioritize making some more mobile actions this or next week. I'd definitely like to get some higher level mobile actions out there!
Title: Re: Creating dual pad controls only using PlayMaker
Post by: Groo Gadgets on March 12, 2012, 12:23:34 AM
I too would love to see this implemented! My 9 year old boy wants to make his own game based on the ios game "minigore" and the would be the perfect starting place for him to get assets working quickly.

Thanks in advance  :-)
Title: Re: Creating dual pad controls only using PlayMaker
Post by: slkdudeman on March 25, 2012, 06:17:51 PM
Would also like to know when this would be available, or if there is any information out there on how to do it now? Im stumped at even trying to create a simple left/right movement buttons with playmaker.
Title: Re: Creating dual pad controls only using PlayMaker
Post by: Alex Chouls on March 29, 2012, 04:14:07 PM
It's taking a little longer than I wanted to make a Touch Joystick action...

In the meantime, have you looked at the Device Actions:
https://hutonggames.fogbugz.com/default.asp?W490

For example, to move something around you can use Get Touch Info and Store Delta Position.

Title: Re: Creating dual pad controls only using PlayMaker
Post by: jeanfabre on March 30, 2012, 05:27:45 PM
Hi,

 Actually, if you can in the next release implement the ability to get Vector 2 properties, then this is pretty much sorted.

 The penelope tutorial available from Unity has a joystick script, and you would simply get it with the action get Property from a fsm Object pointing to that joystick.

 Bye,

 Jean
Title: Re: Creating dual pad controls only using PlayMaker
Post by: jeanfabre on April 06, 2012, 02:19:34 AM
Hi,

 I rolled a quick playmaker action in javascript to plug with the unity joystick controller. I have attached a package with a prefab with the two joystick, texture, scripts and fsm attached. You simply need to extrapolate on this and maybe watch these values from other fsm, or declare the fsm variable as global instead ( I haven't done that to now corrupt your project, simply switch from local to global variable and done).

 One could improve the action to get the number of hit and control the dead zone etc etc. but that's already more advanced and easily done, now that the base is there.


 Bye,

 Jean
Title: Re: Creating dual pad controls only using PlayMaker
Post by: eccoecco on April 22, 2012, 02:56:56 PM
Hi
New convert ( trying to get everyone in Toronto's indie gaming industry hooked too) to playmaker, unity, even basic programming.  In reading the on-line manual I'm running into the issue of items being described as themselves (vector 3 = a variable for storing vector 3 information) this kind of description isn't as helpful as it sounds (I know now though).  Just above is a suggestion to review "get touch info" with the requirement to store your "delta position".  What is a delta position and where an I find a resource that will fill in these blanks that separate my intro/noob  knowledge from that of a full fledged beginner?
Title: Re: Creating dual pad controls only using PlayMaker
Post by: jeanfabre on April 22, 2012, 05:30:17 PM
Hello!

 Ok, the delta position, is the tiny movement that occured between this frame and the last frame. Say you move with your finger the joystick very fast, ths delta value will have a greater value then if you move your finger very slowly.

 a game runs betwen 20 and 60 frame per seconds (fps), so if your delta position is 1 and you are running at 60 fps, it means that the joystick moved 1 unit within 1/60 of a seconds.

does that make sense?

in the package I sent on this thread, you don't need to worry about that, instead, what you likely want with a joystick controller is the actual absolute position, that is, if you maintain the joystick on its right, you will get 1, constantly ( where your delta position would become 0, because you are not moving the joystick anymore).

 So if you want to control a object to move it, you simply multiply the absolute position of the joystick with a speed factor and use that to translate your object.

 Does that make sense?

 Bye,

 Jean
Title: Re: Creating dual pad controls only using PlayMaker
Post by: Archivaldo on August 04, 2012, 01:28:24 AM
Hi, i'm really new with play market and unity in general so Jean please if you can explain  to me how to make the character controller with the joystick step by step or something like that i would greatly appreciate it and im sure that information will be really helpful for other members.

sorry for my bad english and thanks.
Title: Re: Creating dual pad controls only using PlayMaker
Post by: tom3d on August 04, 2012, 03:58:15 AM
Yes a full tutorial would be much appreciated!   
Title: Re: Creating dual pad controls only using PlayMaker
Post by: jeanfabre on August 07, 2012, 09:13:01 AM
Hi,

 ok, I'll work on that. I think tho you should check with Red, he might be willing to do a screencast on this  :P

bye,

 Jean
Title: Re: Creating dual pad controls only using PlayMaker
Post by: tom3d on August 08, 2012, 01:42:34 AM
Great thanks!
Title: Re: Creating dual pad controls only using PlayMaker
Post by: Archivaldo on August 08, 2012, 11:09:15 AM
that's great thank you very much!!!
Title: Re: Creating dual pad controls only using PlayMaker
Post by: jeanfabre on August 09, 2012, 05:07:25 AM
Please wait until I do it  :P
Title: Re: Creating dual pad controls only using PlayMaker
Post by: mickman on October 24, 2012, 07:03:25 AM
Regarding  MobileJoyStickControls  package:

The JoyStickBridge  has an X & Y variable ...  do I need to change this to get the character controller to move .. and if so, how ? 

I have it loaded in a scene... my character + Char. controller has several animations attached. If I hit play in Unity I can Alt click in the PM editor and see my character go from idle to walking.. great.

Currently I have a "Controller Move"  attached to  the Left Joystick Bridge State. + touch transitions.

 Any tips would be really appreciated.

 Mick


Title: Re: Creating dual pad controls only using PlayMaker
Post by: kmgilbert on November 09, 2012, 12:14:52 AM
This never happened no actions were released for this ): im trying to use all playmaker and I still cant figure out how to make a basic two joystick controller.. meaning one for moving and one for camera panning.
Title: Re: Creating dual pad controls only using PlayMaker
Post by: jeanfabre on November 09, 2012, 01:39:20 AM
Hi,

 The package provided earlier on this thread is fully working, so you have all the necessary actions to create this move and camera panning with it:

http://hutonggames.com/playmakerforum/index.php?topic=230.msg5664#msg5664 (http://hutonggames.com/playmakerforum/index.php?topic=230.msg5664#msg5664)

Have already tried to implement that? If so what is the issue you are having with it?


bye,

 Jean
Title: Re: Creating dual pad controls only using PlayMaker
Post by: magarcan on November 22, 2012, 06:13:00 PM
I´m trying to make my controller using the provided package as base.


(http://i50.tinypic.com/29esq5z.png)

It´s not working propertly, any help?

Cheers!
Title: Re: Creating dual pad controls only using PlayMaker
Post by: jeanfabre on November 23, 2012, 12:44:44 AM
Hi,

It's because you need to get a simpler approach.

Simply always feed the "movement" vector with the joystick values and always inject it in your character controller. This will prevent you have to check for variable change.

Have you downloaded the samples from this forum? There is one here for example:
http://hutonggames.com/playmakerforum/index.php?topic=2476.msg11131#msg11131 (http://hutonggames.com/playmakerforum/index.php?topic=2476.msg11131#msg11131)

With your setup, you are likely firing a "infinite loop" warning as you move around. Can you check in your console?

bye,

 Jean
Title: Re: Creating dual pad controls only using PlayMaker
Post by: magarcan on November 23, 2012, 05:58:44 AM
Hi,

It's because you need to get a simpler approach.

Simply always feed the "movement" vector with the joystick values and always inject it in your character controller. This will prevent you have to check for variable change.

Have you downloaded the samples from this forum? There is one here for example:
http://hutonggames.com/playmakerforum/index.php?topic=2476.msg11131#msg11131 (http://hutonggames.com/playmakerforum/index.php?topic=2476.msg11131#msg11131)

With your setup, you are likely firing a "infinite loop" warning as you move around. Can you check in your console?

bye,

 Jean
Yesterday was my second day learning Playmaker  ;D
I'm getting crazy looking for things, because everything is too scattered. Thank you very much for the links.
Title: Re: Creating dual pad controls only using PlayMaker
Post by: jeanfabre on November 23, 2012, 06:24:48 AM
hi,

 yes, don't worry, you'll get there :) it takes some time to get acquainted with common tasks and how to tackle these common design patterns. Also, be sure to watch all the videos you can on playmaker.

bye,

 Jean
Title: Re: Creating dual pad controls only using PlayMaker
Post by: nabilfx on June 30, 2015, 09:43:02 AM
Jean, please how can i conect this 2 values
Title: Re: Creating dual pad controls only using PlayMaker
Post by: jeanfabre on June 30, 2015, 03:41:32 PM
Hi,

Yes, you can save the joystick values into fsm variables in the left pad, and then instead of using "Get axis Vector", you will use "Get Fsm Float" and get these two variabled from your left joystick and inject them into "movement" vector3.

 Bye,

 Jean
Title: Re: Creating dual pad controls only using PlayMaker
Post by: nabilfx on June 30, 2015, 05:03:24 PM
Jean, the Get Fsm Float, stores the value in float, and not in vector3.
What i need to do?
Title: Re: Creating dual pad controls only using PlayMaker
Post by: jeanfabre on July 01, 2015, 04:10:58 AM
Hi,

 You can use the action "set Vector2 XYZ" to set a particular value of a Vector3, and so you can inject the joystick float values into your vector3 variable this way.

Bye,

 Jean
Title: Re: Creating dual pad controls only using PlayMaker
Post by: nabilfx on July 01, 2015, 10:39:42 AM
Jean, please take a look at the package, try to see whats wrong.
http://we.tl/obFXqBxQt0