Hi! I’m Pedrin, I’m Brazil, but I’m having trouble walking and puking, so far I haven’t found the error. The script is this:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Grounded : MonoBehaviour
{
Character Player;
void Start()
{
Player = gameObject.Transform.parent.gameObject.GetComponent();
}
void Update()
{
}
void OnCollisionEnter2D(Collision2D collisor)
{
if(Collisor.GameObject.layer == 8)
{
Player.isJumping = false;
}
}
void OnCollisionExit2D(Collision2D collisor)
{
if (Collisor.GameObject.layer == 8)
{
Player.isJumping = true;
}
}
}