Answers for "how to detect if w is pressed in unity"

C#
9

how to detect a mouse click in unity

using UnityEngine;
using System.Collections;

		if (Input.GetMouseButtonDown(0)) {
        	//Left Mouse Button
        } else if (Input.GetMouseButtonDown(1)) {
        	//Right Mouse Button
        } if (Input.GetMouseButtonDown(2)) {
        	//Middle Mouse Button
        }
Posted by: Guest on August-14-2020
12

unity check if key pressed

if (Input.GetKeyDown(KeyCode.KEY))
Posted by: Guest on June-15-2020

Code answers related to "how to detect if w is pressed in unity"

C# Answers by Framework

Browse Popular Code Answers by Language