Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Missing docs for all physics messages with no parameters

Discussion in 'Documentation' started by Baste, Dec 19, 2017.

  1. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,266
    All of the physics messages (OnTrigger/OnCollision) still work with no parameters. Eg:

    Code (csharp):
    1. private void OnTriggerEnter() {
    2.     //This will get called whenever OnTriggerEnter(Collider other) gets called
    3. }
    I haven't tested every single message, but I believe the version without parameters works for all of them. These versions of the message are not documented, though.


    Skipping messages like this is a particularly large problem - third party code tools can check both the public API and the symbols for methods, but they can't know about undocumented magic methods. In this case, this leads to Rider's plugin not recognizing any of the methods as MonoBehaviour messages.
     
  2. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,442
    You can mark it protected and the message goes away. Not a fix by any means, just fyi.

    Also, I'm now curious if Unity will call both methods if they were both there?