On trigger enter

Hey there, whenever I type OnTriggerEnter2D and allow the editor to autofill it it always names the argument collision “void OnTriggerEnter2D(Collider2D collision)” instead of other “void OnTriggerEnter2D(Collider2D other)”, not sure if this is a setting or not just wondering if anyone knows how to edit this. It’s not a huge issue but it would be kind of nice to edit this.

Hi ShaneCB,

Welcome to our community! :slight_smile:

Do you use Visual Studio Code (VS Code) or Visual Studio (VS)?

If it’s VS Code, you could check the snippets.json file of the Unity code snippets extension on your harddrive and edit it as needed.

I didn’t realize there was two different VS’s. I’m using just Visual Studio, does that make a difference?

Visual Studio is perfectly fine. I use it too.

Is Visual Studio selected as your External Script Editor in Unity (Edit > Preferences > External Tools)? If so, and if there is a button labelled with “Regenerate project files”, click on it.

If VS is selected as your external script editor but the problem persists, close Unity and VS, delete the *.csproj and *.sln files in your project folder. Then launch Unity again. In most cases, that fixes the issue.

That worked, thanks so much for your help!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms