My character is disappearing when I hit the play button.

My character is disappearing when I click play. I don’t know what it causing it. I followed a tutorial and I did EXACTLY the same code has him (because I’m trying to learn how to do a game like that). I don’t understand because nothing in my script is affecting the appearance of my character and yet it still can’t appear. When I don’t use the script, it appears like it should do. When I can’t see him, the animations still work and I can see them working in the animator. Can somebody help me?

public class Player : MonoBehaviour 
{
	private Rigidbody2D myRigidbody;

	private Animator myAnimator; 

	[SerializeField] 
	private float movmentSpeed;

	private bool attack; 

	private bool slide; 

	private bool facingRight;

	[SerializeField]
	private Transform[] groundPoints;

	[SerializeField]
	private float groundRadius;

	[SerializeField]
	private LayerMask whatIsGround;

	private bool isGrounded;

	private bool jump;

	private bool airControl;  

	[SerializeField]
	private float jumpForce;

	// Use this for initialization
	void Start () 
	{
		facingRight = true;
		myRigidbody = GetComponent<Rigidbody2D> ();	
		myAnimator = GetComponent<Animator> (); 
	}

	void Update() 
	{
		HandleInput(); 
	}
	
	// Update is called once per frame
	void FixedUpdate () 
	{
		float Horizontal = Input.GetAxis ("Horizontal");
	
		isGrounded = IsGrounded();

		HandleMovment(Horizontal);

		Flip (Horizontal);

		HandleAttacks(); 

		ResetValues ();
	}

	private void HandleMovment(float Horizontal)
	{
		if (!myAnimator.GetBool("slide") && !this.myAnimator.GetCurrentAnimatorStateInfo (0).IsTag ("attack"))
		{
			myRigidbody.velocity = new Vector2 (Horizontal * movmentSpeed, myRigidbody.velocity.y); 
		}

		{
			if (isGrounded && jump) 
				
				isGrounded = false;
			myRigidbody.AddForce (new Vector2 (0, jumpForce));
		}

		if (slide && !this.myAnimator.GetCurrentAnimatorStateInfo (0).IsName ("Slide"))
		{
			myAnimator.SetBool ("slide", true);
		} 
		else if (!this.myAnimator.GetCurrentAnimatorStateInfo (0).IsName ("Slide"))
		{
			myAnimator.SetBool("slide", false);
		}

		myAnimator.SetFloat("speed", Mathf.Abs (Horizontal));

	}

	private void HandleAttacks()
	{
		if (attack && !this.myAnimator.GetCurrentAnimatorStateInfo (0).IsTag ("attack") && (isGrounded || airControl))
		{
			myAnimator.SetTrigger ("attack");
			myRigidbody.velocity = Vector2.zero;

		}
	}

	private void HandleInput ()
	{
		{
			if (Input.GetKeyDown (KeyCode.Space)) 
				{
				jump = true;
				}
		}

		if (Input.GetKeyDown(KeyCode.LeftShift)) 
		{
			attack = true;
		}
		if (Input.GetKeyDown(KeyCode.LeftControl))
		{
			slide = true;
		}
	}

	private void Flip (float Horizontal)
	{
		if (Horizontal > 0 && !facingRight || Horizontal < 0 && facingRight) 
		{
			facingRight = !facingRight;

			Vector3 theScale = transform.localScale;

			theScale.x *= -1;

			transform.localScale = theScale;   
		}

	}

	private void ResetValues()
	{
		attack = false; 
		slide = false;
		jump = false;
	}

	private bool IsGrounded ()
	{
		if (myRigidbody.velocity.y <= 0)  
		{
			foreach (Transform point in groundPoints)
			{
				Collider2D[] colliders = Physics2D.OverlapCircleAll (point.position, groundRadius, whatIsGround);  

				for (int i = 0; i < colliders.Length; i++)
				{

					if (colliders*.gameObject !=gameObject)* 
  •  			{*
    
  •  				return true;*
    
  •  			}	*
    
  •  		}*
    
  •  	}*
    
  •  }*
    
  •  return false;* 
    
  • }*
    }

Its ok, i solvd it yesterday. My object was just flying up int the air so fast that we couldnt see it. Thanks for your answers still! :smiley: