Sunday, December 25, 2022

Detect multiple keys pressed together unity tutorial

 

Detect multiple keys pressed together unity tutorial




Code:

  //ASSALAM o alaikum 
    using System.Collections; 
    using System.Collections.Generic; 
    using UnityEngine; 
    using UnityEngine.UI; 
    public class MultipleKeysPress : MonoBehaviour 
    { 
      public Text messageText; // Start is called before the first frame update 
      void Start() 
      {
    
      } 
    
    // Update is called once per frame 
      void Update() 
     { 
      if (Input.GetKey(KeyCode.A) &&Input.GetKey(KeyCode.B)) 
      { 
      messageText.text = "A and B pressed together"; 
      }
      else messageText.text=""; 
     } 
    }
  


Video Link :





No comments:

Post a Comment

Take input in Java easy tutorial

  Input taking in Java tutorial Download Link : Download input taking in Java example code ...