How to get VR controller trigger position?

Hi, I want to get the position of the trigger on my vr controllers for simulating hands.

I’ve seen people doing this. Just take a look at vr hands for example.

I should be able to get some values from how much i push the button down. I just don’t know how.

1 Like

Here is a simple method to determine how much the trigger is pressed:

local userInputService = game:GetService("UserInputService")

userInputService.InputChanged:Connect(function(inputObject)
	--[[
	All the triggers:
		Enum.KeyCode.ButtonR1
		Enum.KeyCode.ButtonR2
		
		Enum.KeyCode.ButtonL1
		Enum.KeyCode.ButtonL2
	]]
	if (inputObject.KeyCode == Enum.KeyCode.ButtonR1) then
		print(inputObject.Position.Z)
		-- Returns a percentage from 0 to 1
		-- 0 being not pressed, and 1 being fully pressed
	end
end)