In this Unity tutorial, http://unity3d.com/learn/tutorials/modules/beginner/2d/2d-controllers at 53 minutes in, they use Physics2D.OverlapCircle to check if the character is touching the ground so that they can enable jumping. Since I have a game of all 3D objects, it isn’t working (at least that’s my guess why its not working). So I am looking for a 3D alternative to program this same kind of mechanic.
You are right about why Physics2D.OverlapCircle isn’t working. Unity has 2 physics engines, one for 2D and one for 3D. The two systems cannot interact with each other.
This is the 3D equivalent you’re looking for:
have you tried attaching a character controller? this is how to do it in 3D
using UnityEngine;
using System.Collections;
public class ExampleClass : MonoBehaviour {
void Update() {
CharacterController controller = GetComponent<CharacterController>();
if (controller.isGrounded)
print("We are grounded");
}
}