Search Unity

one step from glory :D

Discussion in 'Scripting' started by monoku, Sep 30, 2014.

  1. monoku

    monoku

    Joined:
    Sep 27, 2014
    Posts:
    7
    thanks for your help
    y have a working scrip for mi dancer is in java but i need to change the "getAxis" for click in the pink buttons of the image

    thanks :D

    #pragma strict

    internal var animator : Animator;
    var v : float;
    var h : float;



    function Start () {

    animator = GetComponent(Animator);

    }

    function Update () {
    v = Input.GetAxis("Vertical");
    h = Input.GetAxis("Horizontal");

    }

    function FixedUpdate (){
    animator.SetFloat ("SALSA", v);
    animator.SetFloat ("BAILE", h);
    }
     

    Attached Files:

    • HELP.jpg
      HELP.jpg
      File size:
      211.9 KB
      Views:
      682
  2. monoku

    monoku

    Joined:
    Sep 27, 2014
    Posts:
    7
    how can change this script to a functional C# script?
     
  3. Fraconte

    Fraconte

    Joined:
    Dec 6, 2013
    Posts:
    327
  4. Fraconte

    Fraconte

    Joined:
    Dec 6, 2013
    Posts:
    327
    You just need something like:
    Code (CSharp):
    1. v = 0;
    2. h = 0;
    3. if(pinkButton1(...))
    4.     v = 1F;
    5. if(pinkButton2(...))
    6.     h = 1F;
    7.  
    (in OnGUI)