Advertisement
soft699

Untitled

Aug 10th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.46 KB | None | 0 0
  1. using System.Collections;
  2. using UnityEngine;
  3.  
  4. public class playercontroller : MonoBehaviour {
  5.     //Declarations de variables
  6.     public int speed = 7, jump = 300;
  7.     public bool isGrounded = false;
  8.     private bool isJumpring = false;
  9.     private Animator Anim;
  10.  
  11.  
  12.     void Start () {
  13.         Anim = GetComponent<Animator> ();
  14.    
  15.     }
  16.    
  17.  
  18.     void Update () {
  19.         float h = Input.GetAxis("Horizontal")
  20.            
  21.             transform.Translate (Vector2.right * h * speed * Time.deltaTime);
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement