C#: Autocompletion does not work for event methods

Default (event) methods are not autocompleted (like: “OnTriggerEnter2D”, “OnLevelWasLoaded”, “Start”, “Update” …) is there an option for these to autocomplete? It would make life easier. (I don’t know all the possible method names by heart).

(I tried “Sync MonoDevelop Project” but it doesn’t resolve the issue)

rgds,
Dave

Yep, that’s how it is unfortunately. It’s because Unity uses “SendMessage” to call those methods rather than them being part of the MonoBehavior class.

I would recommend keeping the documentation window open and copy-pasting from there until you remember them. Don’t worry, you’ll memorize them in time, after you wrote it in the 10000th time :slight_smile:

1 Like

UnityVS has templates for all the internal messages of unity

1 Like

Yeah, the copy-paste idea by Oana is particularly good because of the importance of getting the method’s name case correct, and the fact that if you get it wrong, your method will simply not be called (obviously). With the 2D stuff it can be easy to put a 2d instead of a 2D, etc.

Same problem here , sometimes even if a single character is wrong , it wouldn’t work and you can’t figure out the problem.
I WISH it had this auto-complete thing.

I made an image to make it easier though :slight_smile: :

Build an interface for each one you commonly use. This is the solution that Unity is moving to anyway, as its faster, allows autocomplete and is generally better coding practice.

Witness the replacement of SendMessage with ExecuteEvents.Execute, an OnMouseXXX with the various IPointerXXX interfaces.