Collision detection in 2017 3d 4.2f2
Ive already tried things like:
void onCollisionEnter(Collision col) {
if(col.gameObject.name == "Obstacle")
{
Destroy(col.gameObject);
}
}
And others but they result in errors. This is the official code made by Unity in 2013 but it wont work for me. Im using Unity 3d 2017 4.2f2. Thanks in advance,Ive already tried:
And a few others but they gave errors saying it was obsolete. Why wont this work? Im using Unity 2017 4.2f2.
onCollisionEnter should read OnCollisionEnter with a capital O
Never$$anonymous$$d, just realized my public class wasnt my file name..... lmao. Thanks for the help though. I actually did need a capital hahahah.
Never$$anonymous$$d. I realized that my class wasnt the file name lol. Thanks for the help because i really did need a capital O. Again, thanks.
Your answer
![](https://koobas.hobune.stream/wayback/20220612170710im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Delete object with key within Trigger 1 Answer
How To Make An Object Appear In Front Of Player Without Cloning? 1 Answer
Who collided first 0 Answers
How to destroy on exiting PlayMode/EditMode? 1 Answer
How to destroy only a clone in Unity 3d? 0 Answers