UNITY Trying to trigger CustomEvent with Oculus VR integration input (OVRinput)

553 views Asked by At

When i get input from the Oculus Touch Controllers i want to translate the targetObject. And if i do it directly, it works but when i try to trigger a CustomEvent it doesn't work. (I don't have Oculus Link so i am testing on the Headset). I'm trying hard to make it work with Bolt, maybe that's the problem?

using System.Collections.Generic;
using System.Collections;
using UnityEngine;
using OVRTouchSample;
using System;
using Bolt;

public class MyControllerMapping : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
    
        var targetObject = GameObject.Find("ControllerMappingTestObject");
        if (OVRInput.GetDown(OVRInput.Button.One))
 
        {
 
            CustomEvent.Trigger(targetObject, "A"); //Doesn't work
            
        }

        if (OVRInput.GetDown(OVRInput.Button.One))
 
        {
 
            targetObject.transform.Translate(Vector3.up * Time.deltaTime); //works!
            
        }
        
    }
}


1

There are 1 answers

0
Krystian Piątkowski On

In order to Run Bolt properly it is required to do the AOT Pre-build. Now it works.