OnCollisionExit and OnCollisionEnter not working! please help!!
My code is:
using UnityEngine;
using System.Collections;
public class Detectmovement : MonoBehaviour {
void OnCollisionEnter(Collider colz)
{
print("Touched");
}
void OnCollisionExit(Collider collision)
{
print("You left");
}
}
The error was the message parameter has to be the type of:
In the future, please use the 101/010 button to post code. If you do not do this people will not want to look at your question when it is not formatted to be easily readable. If you do not know how to do use the 101/010 button take a look at the user guide here for an explanation.
Also, you are missing something from your question. At the end you have
The error was the message parameter has to be the type of:
What is the rest of the error? You need to submit everything needed in your question or it can not be answered.
We can only guess without more info, but... Is this 2D or 3D? If you're interacting with Collider2D objects, the two methods in question should be "OnCollisionEnter2D" and "OnCollisionExit2D".
If that's not the issue, please provide more info.
Your answer
![](https://koobas.hobune.stream/wayback/20220612083806im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
OnCollisionEnter Problem 1 Answer
OnCollisionEnter - Enabled C# 1 Answer
Problem with gravity, OnCollisionEnter and OnCollisionExit 2 Answers
How can I make a collider that gives me stat up to stop giving me it? 0 Answers
How can i store all colliders of colliders which collide with a prefab? 1 Answer