using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR.Interaction.Toolkit;
public class ClimbInteractable : XRBaseInteractable
{
void Update() {
OnSelectEnter();
OnSelectExit();
}
protected override void OnSelectEnter(XRBaseInteractor interactor)
{
base.OnSelectEnter(interactor);
if(interactor is XRDirectInteractor)
Climber.climbingHand = interactor.GetComponent<XRController>();
}
protected override void OnSelectExit(XRBaseInteractor interactor)
{
base.OnSelectExit(interactor);
if(interactor is XRDirectInteractor)
{
if(Climber.climbingHand && Climber.climbingHand.name == interactor.name)
{
Climber.climbingHand = null;
}
}
}
}
So, I’m working on a climbing script for my VR or XR whatever you call it and the protected overrides aren’t working I always get this in my console:
Assets/ClimbInteractable.cs(14,26): error CS0115: ‘ClimbInteractable.OnSelectEnter(XRBaseInteractor)’: no suitable method found to override. I also get:
Assets/ClimbInteractable.cs(22,26): error CS0115: ‘ClimbInteractable.OnSelectExit(XRBaseInteractor)’: no suitable method found to override