hello, so I have been working on this little project and I am still very new to game development and programming and I have gotten this issue that I can not FIGURE OUT. where I need to put in a float but it wont accept it.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController : MonoBehaviour
{
private bool isGrounded;
public float jumpForce;
private Rigidbody rb;
public float speed;
private float XInput;
private float ZInput;
public Transform groundCheck;
private float radius;
public LayerMask whatIsGround;
private void Start()
{
rb = GetComponent<Rigidbody>();
}
private void FixedUpdate()
{
XInput = Input.GetAxis("Horizontal");
ZInput = Input.GetAxis("Vertical");
rb.velocity = new Vector3(XInput * speed, rb.velocity.y, ZInput * speed);
isGrounded = Physics.OverlapSphere(groundCheck.position, radius, whatIsGround); //<-- it wont accept "radius"
if (Input.GetKeyDown(KeyCode.Space) && isGrounded == true)
{
rb.velocity = Vector2.up * jumpForce;
}
}
}
please help