Are you using 2D colliders and rigidbodies? If so use this function instead of OnCollisionEnter
void OnCollisionEnter2D(Collision2D coll) { Debug.Log(coll.gameObject.tag); }
Related Posts:
- How to find child of a GameObject or the script attached to child GameObject via script
- Getting mouse position in unity
- How to make the script wait/sleep in a simple way in unity
- Unity OnTriggerEnter2D not registering
- OnCollisionEnter() not working in Unity3D
- Unity cannot convert from ‘string’ to ‘int’
- Can’t add script component because the script class cannot be found?
- Why should I use SerializeField?
- OnTriggerEnter not working at Unity3D
- How to jump in Unity 3d?
- Unity3d no Monobehaviour scripts in the file, or their names don’t match the file name
- Unity3d restart current scene
- How to move 2D Object with WASD in Unity
- The Object you want to instantiate is null. Unity 3D
- Unity 2d jumping script
- OnCollisionEnter2D not being executed?
- Unity “The associated script can not be loaded” and “Win32Exception: The system cannot find the file specified”
- Unity – Gameobject look at mouse
- Error when Building Project: Error building Player because scripts have compile errors in the editor
- Unity3D. Trying to send command for object without authority
- Expression denotes a `type’, where a `variable’, `value’ or `method group’ was expected UNITY3D
- How to pass data (and references) between scenes in Unity
- Rotate object in Unity 3D
- Unity 5.2.2 changing Visual Studio back to MonoDevelop
- “A namespace cannot directly contain members such as fields or methods”
- Unity – How to stop Play Mode in case of infinite loop?
- Unity Scripts edited in Visual studio don’t provide autocomplete
- Is there a keyboard shortcut to maximize the Game window in Unity in Play Mode?
- How to connect to database from Unity
- Convert HTML to PDF in .NET
- C# HttpClient An existing connection was forcibly closed by the remote host
- IOException: The process cannot access the file ‘file path’ because it is being used by another process
- Error : Index was outside the bounds of the array.
- No connection could be made because the target machine actively refused it?
- What does a lock statement do under the hood?
- Could not load file or assembly or one of its dependencies
- All possible array initialization syntaxes
- What is C# equivalent of
- ASP.NET 5 MVC: unable to connect to web server ‘IIS Express’
- Why is this code throwing an InvalidOperationException?
- How to add a default Default.aspx to a ASP.NET Web Application Project?
- Regex for numbers only
- Access to the path is denied
- What does question mark and dot operator ?. mean in C# 6.0?
- ToList().ForEach in Linq
- Proper way to initialize a C# dictionary with values
- Incorrect string value: ‘\xEF\xBF\xBD’ for column
- How do I declare a DefaultValue attribute whose value is an array of strings?
- Get dictionary value by key
- Invalid URI: The format of the URI could not be determined
- SQL Insert Query Using C#
- Convert Linq Query Result to Dictionary
- Get single value from dictionary by key
- What is the difference between “@Scripts.Render” and “
Recommended Hostings
Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.
FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.