Why am I unable to utilize UnityEngine.OnCollisionEnter2D? I anticipated finding this method within the UnityEngine namespace, but it appears to be inaccessible or unrecognized. Visual Studio Code is suggesting the use of VisualScripting.OnCollisionEnter2D instead. Thank you for your assistance.
Have you followed any tutorials on how to use this callback? If so, you should know that it’s a callback on a MonoBehaviour class. It’s not a method you call.
If you type it in the scripting reference it appears here: Unity - Scripting API: MonoBehaviour.OnCollisionEnter2D(Collision2D)
If you are having VS intellisense issues then there’s a forum for that here: Unity Engine - Unity Discussions
NOTE: I moved your post out of the 2D forum to here because this isn’t a 2D physics issue, it’s a Scripting/IDE issue.
1 Like