playMaker

Author Topic: Virtual Joystick Ecosystem Sample [ECOSYSTEM] [JULY 2019]  (Read 17937 times)

ETGgames

  • Junior Playmaker
  • **
  • Posts: 56
    • ETGgames
Re: Virtual Joystick Ecosystem Sample
« Reply #15 on: August 03, 2015, 03:52:07 PM »
Here it is:

ETGgames

  • Junior Playmaker
  • **
  • Posts: 56
    • ETGgames
Re: Virtual Joystick Ecosystem Sample
« Reply #16 on: August 04, 2015, 04:41:16 PM »
Ok, here it is

PunkMunkey

  • Playmaker Newbie
  • *
  • Posts: 5
Re: Virtual Joystick Ecosystem Sample
« Reply #17 on: August 09, 2015, 11:29:45 PM »
This is absolutely fantastic! Thank you so much. This just saved me $50 on buying something from the asset store. This does the same thing so much simpler.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15502
  • Official Playmaker Support
Re: Virtual Joystick Ecosystem Sample [ECOSYSTEM] [JULY 2019]
« Reply #18 on: July 15, 2019, 03:40:53 AM »
Hi Everyone,

 ok, so this sample has been updated to work with the PlayMaker's built in UI support. Thanks for Djaydino for the porting.



Bye,

 Jean

Seiryu33

  • Full Member
  • ***
  • Posts: 133
Re: Virtual Joystick Ecosystem Sample [ECOSYSTEM] [JULY 2019]
« Reply #19 on: October 23, 2019, 02:28:06 AM »
Hi. Is there a tutorial on using it? I'm trying to implement virtual controls for Android, and got really confused about where to even start. Using my own assets doesn't give me the responsiveness I want. I drag the prefab into the scene and nothing appears in scene view. I'm totally lost.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15502
  • Official Playmaker Support
Re: Virtual Joystick Ecosystem Sample [ECOSYSTEM] [JULY 2019]
« Reply #20 on: October 29, 2019, 03:45:35 AM »
Hi,

 It's actually quite simple, don't over think this.

 you need to drag the UI joystick prefab in a canvas, or UI panel, if you don't see it in the Game view, make sure it's placed properly.

then,
- create a new gameobject
- add a new Fsm
- in the start state, add an action GetFsmFloat
- target the joystick prefab instance, and get for example the x value of the fsm "Joystick interface", the GetFsmFloat action should guide you to pick the fsm and the value once you have referenced the UI joystick instance.
- make sure the GetFsmFloat action runs everyframe

that's it, now you have the x values of the joystick interface.

check out the object Panel X to see how it's done.

Bye,

 Jean




colpolstudios

  • Sr. Member
  • ****
  • Posts: 367
Re: Virtual Joystick Ecosystem Sample [ECOSYSTEM] [JULY 2019]
« Reply #21 on: November 08, 2019, 10:25:26 AM »
I was able to setup the right mobile control stick for my camera quite easily but having trouble figuring out how to setup the left one so that my character will move.

Please view the screenshot of the current setup.


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15502
  • Official Playmaker Support
Re: Virtual Joystick Ecosystem Sample [ECOSYSTEM] [JULY 2019]
« Reply #22 on: November 11, 2019, 02:32:11 AM »
Hi,

It seems you are using GetAxis action instead of using getFsmFloat and get the input from the joystick fsm. I think that's all there is to it.

Bye,

 Jean

colpolstudios

  • Sr. Member
  • ****
  • Posts: 367
Re: Virtual Joystick Ecosystem Sample [ECOSYSTEM] [JULY 2019]
« Reply #23 on: November 14, 2019, 08:11:32 AM »
Although yes I can get the X and Y floats from the joystick FSM

my character will only walk forwards.

I'm thinking that this is due to my current animator setup, as he is always walking forwards.

The input direction compass, however, ensures that the character is looking in the right direction.

The Camera autolook is a child of the input direction compass, in the movement fsm with the "smooth look at" pointed to this object.

Should I be using the floats in the joystick FSM here as well?

But what about the relative to main camera, how does this fit in?


 

colpolstudios

  • Sr. Member
  • ****
  • Posts: 367
Re: Virtual Joystick Ecosystem Sample [ECOSYSTEM] [JULY 2019]
« Reply #24 on: November 24, 2019, 04:45:18 PM »
So I have tried to use the 3d position and it kinda works,

But it only allows the movement to be left and right. No forward or backward.

I would very much appreciate jeans help and advise.




jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15502
  • Official Playmaker Support
Re: Virtual Joystick Ecosystem Sample [ECOSYSTEM] [JULY 2019]
« Reply #25 on: November 25, 2019, 01:23:12 AM »
Hi,

 does it work if you swap back to using get axis input?

If your input coming from the joystick indicates a vertical value between -1 and 1, then it's not a problem with the joystick input itself. Can you verify this?

Bye,

 Jean

colpolstudios

  • Sr. Member
  • ****
  • Posts: 367
Re: Virtual Joystick Ecosystem Sample [ECOSYSTEM] [JULY 2019]
« Reply #26 on: November 25, 2019, 12:18:43 PM »
using the 3d position x -1 = move right and x 1 = move left.

It does show y 1 as up on the joystick but the character does not change direction.

It also shows y -1 as down on the joystick but the character does not change direction.

When I switch back to using the get axis input and using keyboard controls.

It shows x 1 = move Right, x -1 = move left

using up arrow Z = 1, using down arrow Z = -1

Note if I use a controller joystick these values are the same.




jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15502
  • Official Playmaker Support
Re: Virtual Joystick Ecosystem Sample [ECOSYSTEM] [JULY 2019]
« Reply #27 on: November 25, 2019, 01:18:13 PM »
Hi,

 ok, I see: the getAxisInput, outputs ( vector3(x input,0,y input), but the joystick outpus( vector3(x input, y input),

you just need to copy the y value to the z right after you get the value from the joystick, or edit the joystick fsm, so that it output in the z component of the vector3.

Bye,

 Jean



colpolstudios

  • Sr. Member
  • ****
  • Posts: 367
Re: Virtual Joystick Ecosystem Sample [ECOSYSTEM] [JULY 2019]
« Reply #28 on: November 25, 2019, 04:48:19 PM »
So I edited the Thumb interactive FSM as can be seen in the attached screenshot.

It works a treat.

However, this is only one element that needs changing as I will need to create a new movement FSM for the android/mobile system.

Plus the new canvas buttons to aim, shoot reload and grenades.

But once I get this all working I will have a rather good system.

keyboard/mouse control

Joystick control with the ability to remap the buttons.

Mobile controls.

I will do a special build on web gl and post it with my updates.

Can I post a link here when finished?




jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15502
  • Official Playmaker Support
Re: Virtual Joystick Ecosystem Sample [ECOSYSTEM] [JULY 2019]
« Reply #29 on: November 26, 2019, 01:29:16 AM »
Hi,

 of course, sharing is caring :) so feel free to share your work, it will be appreciated.

Bye,

 Jean