Hi together
I’m trying to vibrate the rift s Controller with a sound clip and Unity Always crashes/freezes… ![]()
I have tryed this two solutions without success:
public AudioClip sfxHit;
OVRHaptics.Channels[0].Mix(new OVRHapticsClip(sfxHit));
and
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Saber : MonoBehaviour
{
public LayerMask layer;
public AudioClip sfxHit;
public ParticleSystem Explosion;
private AudioSource source;
private OVRHapticsClip hapticsClip;
void Start()
{
source = GetComponent<AudioSource>();
hapticsClip = new OVRHapticsClip(sfxHit);
}
void Update()
{
RaycastHit hit;
if (Physics.Raycast(transform.position, transform.forward, out hit, 1, layer))
{
OVRHaptics.RightChannel.Mix(hapticsClip);
Explosion.transform.position = gameObject.transform.position;
Explosion.Play();
Destroy(hit.transform.gameObject);
}
}
}
Anyone a idea what i’m making wrong?