Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

input unity

void Update() 
{ 
    if (Input.GetKeyDown(KeyCode.Space)) 
    { 
        // Spacebar was pressed 
    } 
        if (Input.GetMouseButtonDown(0)) 
    { 
        // Left mouse was pressed 
    } 
}
Source by gamedevbeginner.com #
 
PREVIOUS NEXT
Tagged: #input #unity
ADD COMMENT
Topic
Name
6+4 =