Комментарии:
Thanks you came in clutch for this game jam
ОтветитьOMG thank you !!!! the way they explained it in class was with a IEnumerator subroutine, found it difficult to understand.
ОтветитьWhen I do the other keys it only does one of em.
ОтветитьYou deserve an Oscar, sir
Ответитьbig thanks
Ответитьcould you please leave the script in the comments? i do a mistake it doesent work
Ответитьhow do you make it so that if you are close to an object the sound gets louder (for example if you are near a chest and the chest sound gets louder so the player knows theyre near a chest?)
Ответитьhow would i pause this sound when i'm jumping so that in the air if i go to the left or right, i don't hear footsteps until i've landed
Ответитьwhat if i want to move left side with footsteps sounds?
Ответитьplease help. how i use your code in my code?!
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Player : MonoBehaviour {
public float maxSpeed;
bool grounded = false;
float groundCheckRadius = 0.2f;
public LayerMask groundLayer;
public Transform groundCheck;
public float jumpHeight;
Rigidbody2D myRB;
Animator myAnim;
bool facingRight;
// Use this for initialization
void Start () {
myRB = GetComponent<Rigidbody2D> ();
myAnim = GetComponent<Animator> ();
facingRight = true;
}
void Update(){
if (grounded && Input.GetKeyDown (KeyCode.Space)) {
grounded = false;
myAnim.SetBool ("isGrounded", grounded);
myRB.AddForce(new Vector2(0, jumpHeight));
}
}
void MoveRight(){
Vector2 position = transform.position;
position.x += speed;
transform.position = position;
}
// Update is called once per frame
void FixedUpdate () {
grounded = Physics2D.OverlapCircle (groundCheck.position, groundCheckRadius, groundLayer);
myAnim.SetBool ("isGrounded", grounded);
myAnim.SetFloat ("verticalSpeed", myRB.velocity.y);
float move = Input.GetAxis ("Horizontal");
myRB.velocity = new Vector2 (move * maxSpeed, myRB.velocity.y);
myAnim.SetFloat ("speed", Mathf.Abs (move));
if (move > 0 && !facingRight) {
Flip ();
}
else if(move<0&& facingRight)
{
Flip();
}
}
void Flip(){
facingRight = !facingRight;
Vector3 theScale = transform.localScale;
theScale.x *= -1f;
transform.localScale = theScale;
}
}
This is kinda clunky. Footstep sounds need to start when the animation hits his feet to the ground.
Ответитьjust saved me dude cheers
Ответитьthank you so much
Ответитьhow can i stop the footstep sound while jumping?
Ответитьhey this is very good tutorial :) im not coder i try to make this to left side but i cant ;/ ehh
Ответить