using System.Collections; using System.Collections.Generic; using UnityEngine; public class VibrationEffect : MonoBehaviour { public VibrationSettings Settings; private HapticsEffect haptics; public bool DoVibration = false; private void Awake() { haptics = FindObjectOfType(); } [ContextMenu("Vibrate")] public void Vibrate() { haptics.Vibrate(Settings); } private void Update() { if (DoVibration) Vibrate(); } }