Question by
houditi121 · May 28, 2020 at 01:21 AM ·
player movementdebug
My collsion/groundcheck srcipt has an error, cs0131, variable must be on
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerCollision : MonoBehaviour
{
void Jump()
{
if (Input.GetButtonDown("Jump"))
{
gameObject.GetComponent<Rigidbody2D>().AddForce(new Vector2(0f, 5f), ForceMode2D.Impulse);
}
}
void OnCollisionEnter2D(Collision2D other)
{
if (other.gameObject.tag == "Ground")
{
Jump() = true;
}
else
{
Jump() = false;
}
}
}
Comment