Trigger not detected
For some reason triggers aren`t detecting in my game. I`ve checked that one object has a rigidbody (not kinematic and kinematic) and capsule collider and the other object has a capsule collider that is a trigger (and I`ve added a rigidbody to it during an instance) Both objects are on the same layer and I`ve tried changing a variety of things and using another object to detect a collision or trigger and even that failed. Below is the code for the playercontroller that should detect the trigger. I`ve also attached screenshots of the two object inspectors to this post.
using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerController : MonoBehaviour { public float moveSpeed = 15; private Vector3 moveDir; public static int rescued = 1; void onTriggerEnter (Collider other) { Debug.Log ("collision with survivor"); if (other.tag == "Survivor") { rescued += 1; print ("collision with survivor"); } } ![alt text][1] void Update () { moveDir = new Vector3 (Input.GetAxisRaw ("Horizontal"), 0,Input.GetAxisRaw ("Vertical")).normalized; } void FixedUpdate (){ GetComponent<Rigidbody> ().MovePosition(GetComponent<Rigidbody>().position + transform.TransformDirection (moveDir) * moveSpeed * Time.deltaTime); } }
I feel like there may be something Im unaware of, can anyone help?