Interactable Objects in VR
Jul 20, 2024
Now that I hold the gun in the appropriate way, time to make it fire. To do this, I will use the Interactable Events in XR Grab Interactable.
Within the Interactable Events, I can the script to do “something” whenever a specific interaction is called upon by the player. In this case, I want to use the Activate event (which is the main trigger pull on the controller).
I call the Pistol Controller script, and then the TriggerPull() method within that script to activate whenever Activate happens. In this case, it was nice and pre-scripted for a muzzle flash to occur.