Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

unity FixedUpdate

void Update()
{
    //player movement
    vInput = Input.GetAxis("Vertical") * moveSpeed;
    hInput = Input.GetAxis("Horizontal") * rotateSpeed;
    
    if(Input.GetKeyDown(KeyCode.Space)){
        isJumping = true;
    }

    if(Input.GetMouseButtonDown(1)){
        isShooting= true;
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #unity #FixedUpdate
ADD COMMENT
Topic
Name
9+4 =