- Home /
Question by
Ayame1227 · Sep 22, 2021 at 02:00 AM ·
scripting problemprefabvr
Assign Object to Unity Event (Select Entered) of Prefabbed Game Object with "XR Grab Interactable"
Hi, I am creating VR game and I realized assigned object on UnityEvent in "XR Grab Interactable" are removed when I made GameObject to Prefab. The UnityEvent is "Select Entered (SelectEnterEventArgs)". I spawn this Prefab during Runtime.
Could anyone advise me how I should write the script to assign the object to Prefab's UnityEvent "Select Entered (SelectEnterEventArgs)" during Runtime.
Thanks,
Comment
Best Answer
Answer by Ayame1227 · Sep 22, 2021 at 05:36 AM
I just solved issue by attach script written the method which include the object and its method I want to call. When Prefab the GameObject, prefab keep the assigned object on UnityEvent when it's attached to Prefabbed GameObject.