Extending the XR Interactions Toolkit (XRBaseInteractor)

I’m attempting to extend the abstract class for XRBaseInteractor, using XRBaseControllerInteractor as a template and the guidance in the documentation: XR Interaction Toolkit | XR Interaction Toolkit | 0.9.4-preview.

I’ve almost made it through, but am having trouble calling OnActivate() on an XRBaseInteractable from within my new Interactor class, since the OnActivate function is marked as internal. My understanding is that means that activating Interactables is not possible outside of the XR Interaction Toolkit assembly.

// This code is from XRBaseControllerInteractor.cs in the ProcessInteractor() function.
// Where selectTarget is an XRBaseInteractable, declared in XRBaseInteractor.cs
if (selectTarget && m_Controller.activateInteractionState.activatedThisFrame)
    selectTarget.OnActivate(this);
if (selectTarget && m_Controller.activateInteractionState.deActivatedThisFrame)
    selectTarget.OnDeactivate(this);

The error I get is ‘XRBaseInteractable.OnActivate(XRBaseInteractor)’ is not accessible due to its protection level. Does that mean it’s not possible to extend the Interactors such that they can call on the Interactables? I assume I’m missing/misunderstanding something.

Thanks for any help and clarification!

I’m not sure if you need the OnActivate call (you probably do, I haven’t checked), but to call it, see this:

XR Input Toolkit 2020 FAQ – Snap and Plug?

1 Like

Thanks! Exactly what I was looking for.

The site is no longer available… How do you handle internal methods you wish to use/modify?

Apologies: AWS is having serious problems - the server keeps going offline after 30 mins to a few hours, with no errors, and the AWS reporting tools randomly declaring “server is live” or “server is offline”. I’m trying to build a fresh server to replace it, but it’s taking some time to figure out what the cause of the crashes is.

Until then: I’m rebooting it each day, and it’s live for a brief time, until AWS crashes again (argh!)

Finally fixed, ported to a new host, site rebuilt. Theme is a bit ugly, but should be running much faster (all on AWS now).