Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void animate (){
- if (horizontal > 0 ) {
- anim.SetBool("Run", true);
- sr.flipX = false;
- }
- else if (horizontal < 0 ) {
- anim.SetBool("Run", true);
- sr.flipX = true;
- }
- else {
- anim.SetBool("Run", false);
- }
- if(body.velocity.y > 1) {
- anim.SetTrigger("Jump");
- }
- if(body.velocity.y < -1) {
- anim.SetTrigger("Fall");
- }
- }
- void playerJump (){
- if (Input.GetButtonDown("Jump") && isGrounded) {
- isGrounded = false;
- body.AddForce(new Vector2(0f, 7f), ForceMode2D.Impulse);
- }
- }
- void attack2 (){
- if (Input.GetButtonDown("Fire2")) {
- anim.SetTrigger("Attack2");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement