Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

FPS Controller move forward via mobile touch

Discussion in 'General Discussion' started by izeko2004, Jan 1, 2015.

  1. izeko2004

    izeko2004

    Joined:
    Dec 28, 2014
    Posts:
    74
    How can i make the character move forward when the user touches a certain part of the phone screen.

    I have tried this below, but not sure what UPText and UpStyle are:

    Code (CSharp):
    1. if(GUI.Button(Rect(Screen.width/2+195,Screen.height-130,40,40), UpText, UpStyle)){
    2.             transform.localPosition += transform.forward * speed * Time.deltaTime;
    3.         }
    Can anyone help?
     
  2. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    You're pretty much in a section of the forums with unproductive gossips. I'd suggest though using the free Unity Technologies package 'Unity 4.6 Sample Assets' in the asset store. It has 2 or 3 character controllers that pretty much already to that for you.
     
    izeko2004 likes this.
  3. izeko2004

    izeko2004

    Joined:
    Dec 28, 2014
    Posts:
    74
    Thanks for the reply. I will take a look at this.