Advertisement
Wolverine_X-Man

Player.cs

Mar 5th, 2021
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.00 KB | None | 0 0
  1. using UnityEngine;
  2.  
  3. public class Player : MonoBehaviour
  4. {
  5.  
  6.     // Start is called before the first frame update
  7.     void Start()
  8.     {
  9.        
  10.     }
  11.  
  12.     void Update()
  13.     {
  14.         // Input w and print message..
  15.         if (Input.GetKeyDown(KeyCode.W))
  16.         {
  17.             print("W is Pressed In print");
  18.             Debug.Log("W is Pressed in Debug.Log");
  19.         }
  20.        
  21.         // input Space and print
  22.         if (Input.GetKeyDown(KeyCode.Space))
  23.         {
  24.             Debug.Log("Space Pressed");
  25.         }
  26.        
  27.         // input BackSpace and print
  28.         if (Input.GetKeyDown(KeyCode.Backspace))
  29.         {
  30.             Debug.Log("BackSpace Pressed");
  31.         }
  32.        
  33.         ///////////////////////////////////////////////////////////
  34.  
  35.         if (Input.GetKey(KeyCode.LeftControl))
  36.         {
  37.             print("left Control -> getkey");
  38.         }
  39.  
  40.         if (Input.GetKeyUp(KeyCode.Q))
  41.         {
  42.             print("pressed q -> getKeyUp");
  43.         }
  44.     }
  45. }
  46.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement