Currently OnCollisionEnter says its unused (IDE0051), even though im following strictly on the Junior Programmer Mission, and im not sure why. The Box Collider is on if that’s useful. here’s the entire script.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController : MonoBehaviour
{
private Rigidbody playerRb;
public float jumpForce;
public float gravityMultiplier;
public bool isOnGround = true;
// Start is called before the first frame update
void Start()
{
playerRb = GetComponent<Rigidbody>();
Physics.gravity *= gravityMultiplier;
}
// Update is called once per frame
void Update()
{
if(Input.GetKeyDown(KeyCode.Space)&& isOnGround == true)
{
playerRb.AddForce(Vector3.up * jumpForce, ForceMode.Impulse);
isOnGround = false;
}
}
private void OnCollisonEnter(Collision collision)
{
isOnGround = true;
}
}