Socket Interaction to Get Things Done!
Objective: Understand how to set up and use Socket Interactors!
First, what are Socket Interactors? Socket Interactor is an interactor that is designed to be attached to an object. They are used to hold other interactable via a socket.
In this tutorial we are going to use a lock and key to showcase how socket interactors work. Select the object you want to be a socket and add the Socket Interactor component.
Hovering is a big component of Socket Interactos. To be able to do this you will need to add a collider, for this example we are going to use a sphere collider.
One of the great features that comes standard is the ‘Show Interactable Hover Material’. What this does is it shows a translucent copy of the object you are docking into the socket. This appears when your object is within the collider we just created.
As we have done so in the past, we can create an attach transform so when the key snaps into the Socket Interactor with the correct transform.
At this point the socket is working perfectly. Unfortunately, this will also socket any object that has an interactable on it. To prevent unwanted objects to interact with the socket we can use the Layer Mask section on the interaction component. Since I’m using a key, I’ll make a key layer.
Now all you need to do is set both the socket and the key objects to be on the “Key” layer.
The last phase for a Socket Interactor would be the Interactor Events. We’ve talked about these before, these are events that are triggered when a certain action is taken. Socket Interactor have four such events. Two for hovering on this interactor, and then selecting/deselecting.
Now you know everything need to start using Socket Interactors. Don’t be afraid to experiment with your Sockets, and I’ll see you in the next tutorial!