Customize Attachment Points

Customize a Realistic Attachment Point for the Pistol

Jordan T Kay
2 min readApr 27, 2024

By default, Unity uses the game objects position to set the attachment point. This means that the virtual hand prefab’s position and the pistol prefab position will align to simulate the grabbing action.

WHERE IS THE POSITION OF THE GAMEOBJECT?
The position of the game Object can be visualized through the TRANSFORM GIZMO

To have the hand have a more realistic attachment point, we need to use a property included within the XR Grab Interactable called Attach Transform.

WHAT IS THE ATTACH TRANSFORM?
The attach transform is the point unity uses on the game object

DEFAULT TRANSFORM POSITIONS

CREATE ATTACHMENT POINT

To use a new position transform to customize the attachment point, we need to create a new child gameObject called AttachmentPoint and assign it to the Attach Transform on the XR Grab Interactable. This will give us a child object of the pistol who’s position we can alter, thus allowing us to customize our attachment point.

The nice thing about using a dedicated object for the attachment position, is that we can also adjust the rotation.

--

--

Jordan T Kay

Join my journey into game development with Unity. Learning all I can to produce quality games. 🚀