playMaker

Author Topic: Easy Touch 5 - Get Axis Float for Mecanim  (Read 4210 times)

che1974

  • Playmaker Newbie
  • *
  • Posts: 12
Easy Touch 5 - Get Axis Float for Mecanim
« on: October 20, 2016, 10:12:19 AM »
Hi all,
I have a Problem to get the Float from Easy Touch Joystick to Set the Mecanim Animator Float.
With WSAD is all ok with the BlendTree.
When i use WSAD, i will get the Property from the Joystick as Float.
But with the Joystick nothing ....
The Object runs in idle Position.

I am no Coder - use Playmaker ;-)
 

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Easy Touch 5 - Get Axis Float for Mecanim
« Reply #1 on: October 20, 2016, 11:32:43 AM »
Hi,
I don't have easy touch 5 yet but i believe it has its own playmaker actions that you can use,

When you play, on the get properties can you see if the value changes?

If so you can use them directly with the Set Animator float.

Get axis works only on Controllers, buttons, keys, etc. that are setup in the 'inputmanager' (you can find it in "edit/project settings)

che1974

  • Playmaker Newbie
  • *
  • Posts: 12
Re: Easy Touch 5 - Get Axis Float for Mecanim
« Reply #2 on: October 20, 2016, 01:08:48 PM »
It has it own playmaker actions -
but not for the joystick or to get the axis.

This Script (put it on the Player) will not work, but there is no error   (It is a Test - i am no Coder).
------------------------------------
using UnityEngine;
using System.Collections;

public class joystick_input : MonoBehaviour {
   public float hSpeed = 0f;
   public float vSpeed = 0f;
   private Animator anim;

   void Start () {
      anim = GetComponent<Animator> ();
   }  
   // Update is called once per frame
   void FixedUpdate () {
     
      //Easy Touch Controller Input
      // hSpeed and vSpeed  Blendtree Parameter
      float hSpeed = ETCInput.GetAxis("Horizontal");        
      float vSpeed = ETCInput.GetAxis("Vertical");
   }
}
-------------------------------------------

I will set the globals Var and Parameter (hSpeed and vSpeed) for the Blendtree.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Easy Touch 5 - Get Axis Float for Mecanim
« Reply #3 on: October 20, 2016, 02:22:48 PM »
Hi,
Maybe you can ask the author to make those actions, or a script that will work with playmaker.

che1974

  • Playmaker Newbie
  • *
  • Posts: 12
Re: Easy Touch 5 - Get Axis Float for Mecanim
« Reply #4 on: October 20, 2016, 03:17:42 PM »
Thanks.
I hope i will get it there - Easy Touch is a great Plugin - but not easy for Mecanim.

che1974

  • Playmaker Newbie
  • *
  • Posts: 12
Re: Easy Touch 5 - Get Axis Float for Mecanim
« Reply #5 on: December 16, 2016, 04:49:25 AM »
Hi all,

I have my simple solution for Easytouch Controls Joystick Axis - and it works fine.
https://www.assetstore.unity3d.com/en/#!/content/3322

Maybe someone needs it or would like to make a Playmaker custom action.

C# Script
--------------------
using UnityEngine;
using System.Collections;

public class MyJoystick : MonoBehaviour {
   Animator animator;
   void Start () {
      animator = GetComponent<Animator> ();
   }
   void Update () {
      float h = ETCInput.GetAxis("Horizontal");
      float v = ETCInput.GetAxis ("Vertical");
                // hspeed and vspeed are my Animator Parameters in Blendtree
      animator.SetFloat ("hspeed",h);
      animator.SetFloat ("vspeed",v);
   }
}
--------------------------