Error importing Apex Path

  • August 10, 2018 at 00:59 #23608
    owaaan
    Participant

    I’m getting this error on import:

    Assets/Apex/Apex Path/Scripts/Units/UnitComponent.cs(235,49): error CS0619: UnityEngine.Physics.minPenetrationForPenalty' is obsolete:use Physics.defaultContactOffset or Collider.contactOffset instead.’

    Just want to be sure how to fix it as they give two different options.

    August 10, 2018 at 10:35 #23611
    Geminior
    Keymaster

    If you look at the code you will see the following:

    #if UNITY_5 || UNITY_2017
    totalOffset -= (2 * coll.contactOffset);
    #else
    totalOffset -= (2 * Physics.minPenetrationForPenalty);
    #endif

    So the answer is that contactOffset is what you want to use. Simply add || UNITY_2018 to the compiler directives.

    #if UNITY_5 || UNITY_2017 || UNITY_2018
    totalOffset -= (2 * coll.contactOffset);
    #else
    totalOffset -= (2 * Physics.minPenetrationForPenalty);
    #endif

You must be logged in to reply to this topic.

Topic Tags