I want to make the built-in FPS controller collide with an object and switch a boolean to true. Here is my code:
public static bool WellGUIOn;
// Use this for initialization
void Start () {
WellGUIOn = false;
}
void OnCollisionEnter (Collision c)
{
if (c.gameObject.name == "Well") {
WellGUIOn = true;
} else {
WellGUIOn = false;
}
I have attached this script to the FPS controller and added a box collider on both prefabs (with is trigger ticked). The FPS controller already has a rigidbody(with kinematic ticked) and I added a rigidbody (with kinematic NOT ticked) to the object. Unfortunately, it doesn't work. How can I solve this?