As mentioned on slack here is the tutorial for how I've set up gameobjects to detect when the straight pointer selects them.
For those wondering how to get a GameObject to detect if it has been selected by the straight pointer, this is a method I have found that does not require any coding.
The objective is to create a simple button that will detect when it has been selected by the straight pointer.
Add the straight pointer prefab to the scene. Setup the straight pointer buttons to behave as you would like.
Attach a follow source, the Alias for the hand/controller you wish to use.
Attach a ‘activation action’ for the controller button that you want to activate the pointer. i.e Press
You can ignore the ‘selection action’ as the Interactor (as described in the following steps will behave as the selector)
Open up the straight pointer prefab until you reach the child ‘ValidSphere’
Take a copy of the Interactor prefab and add as a child to the ValidSphere
Click on the interactor prefab under the ‘Interactor Settings’ Fields set ‘Grab Action’ to be the button you would like to behave as your select button for the pointer. i.e Touch
While still on the Interactor go to the Rigidbody Component and freeze the x,y,z for the position and rotation constraints.
Go back to the Straight Pointer (ObjectPointer.Straight) and under the ‘pointer events’ dropdowns open up ‘Exited’ add an event by clicking the + sign. Now drag and drop the ‘Interactor’ as the object and set as ‘InteractorFacade.Ungrab’
Now we have set up the pointer we need to create an object that will detect the pointer.
Start by taking an Interactable.Primary_Grab.Secondary_None Prefab and place it in the Hierarchy.
Select the Interactable object and set its Rigidbody component’s constraint fields to Freeze all x,y,z for position and rotation.
Open up Interactable.GrabAction.FollowAction on the interactable.
Set Interactable settings to the following;
Follow tracking = Follow RigidBody
Grab Offset = Force Precision Point
Is Kinematic When Inactive = Checked
To test that it works under the ‘Touch Events’ for the Interactable object add a event for Last Ungrabbed and set it to the Interactable object itself and make set to GameObject.SetActive as unchecked.
This will remove the gameobject from the screen when you select it with the pointer.
Took me a lot of trail and error to figure this out.