Collision or Triggers both not working. 3D.
I'm trying to make collision work for my game but unfortunately, I'm having no success, after looking at multiple guides online I can't see why the collision isn't being detected.
About the collision.
A cube object is falling into/onto a Sphere object.
Both have rigid bodies (3D rigid bodies).
One is kinematic (The sphere which is being fell on)
Both are not children in any element, They are both parent-elements
They both have box colliders.
I have tried all combinations of ticking "Is trigger" (On either, on both, on none).
My current script looks like this:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class hittest : MonoBehaviour {
void onTriggerEnter(Collider col) {
print("test2");
Debug.Log ("test");
if (col.gameObject.CompareTag ("Win")) {
col.gameObject.SetActive(false);
}
}
void onCollisionEnter(Collision col) {
print("test3");
Debug.Log ("test");
if (col.gameObject.CompareTag ("Win")) {
col.gameObject.SetActive(false);
}
}
}
I have tried looking everywhere on the internet with no success. If you need any more details, ask.
Your answer
Follow this Question
Related Questions
Collision With Text 0 Answers
[SOLVED]OverlapingSphere damage only one enemy 1 Answer
How to let a object dodge a collision? 0 Answers
Who collided first 0 Answers
How to make a bowl? 0 Answers