Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Resolved "error CS0115... no suitable method found to override" after Unity update

Discussion in 'XR Interaction Toolkit and Input' started by Cooleobrad, Dec 2, 2020.

  1. Cooleobrad

    Cooleobrad

    Joined:
    Dec 16, 2016
    Posts:
    15
    I recently updated my version of Unity and the XR package, but have been met with errors when trying to compile my previous project.

    As an example
    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.XR.Interaction.Toolkit;
    3.  
    4. public class OffsetGrab : XRGrabInteractable
    5. {
    6.     private Vector3 interactorPosition = Vector3.zero;
    7.     private Quaternion interactorRotation = Quaternion.identity;
    8.  
    9.     protected override void OnSelectEnter(XRBaseInteractor interactor)
    10.     {
    11.         base.OnSelectEnter(interactor);
    12.         StoreInteractor(interactor);
    13.         MatchAttachmentPoints(interactor);
    14.     }
    15.  
    When I hover over "OnSelectEnter" it says, "CS0117:'XRGrabInteractable' does not contain a definition for 'OnSelectEnter'". I have the same issue with "OnSelectExit" later on in the code for this file. How do I go about fixing this?
     
    Sammyueru1 likes this.
  2. mfuad

    mfuad

    Unity Technologies

    Joined:
    Jun 12, 2018
    Posts:
    334
  3. Marieke_F

    Marieke_F

    Joined:
    Oct 21, 2020
    Posts:
    1
    Hey I stumbled on the same issue today. Could you resolve it? and How did you do it?
    Thanks in advance
     
  4. mfuad

    mfuad

    Unity Technologies

    Joined:
    Jun 12, 2018
    Posts:
    334
    Hi @Marieke_F, can you file a bug with reproducible project so the team can take a look? Thanks.
     
  5. OstrichBoy

    OstrichBoy

    Joined:
    Dec 28, 2014
    Posts:
    15
    I have the same Issue. Did you fix it?
     
  6. gjf

    gjf

    Joined:
    Feb 8, 2012
    Posts:
    53
    Weren't those methods renamed as
    OnSelectEntered
    and
    OnSelectExited
    ?
     
    brasseurphoto_unity and Hickey like this.
  7. mfuad

    mfuad

    Unity Technologies

    Joined:
    Jun 12, 2018
    Posts:
    334
    Please see this thread for more details.
     
  8. brasseurphoto_unity

    brasseurphoto_unity

    Joined:
    Nov 22, 2021
    Posts:
    1
    This worked for me.
     
    VRDave_Unity likes this.