Assistance with VR

Heyo
I am currently making a VR game and I want to shoot a fireball using where the players head is facing. VR is fairly new and I am not sure what I would use.

Anything helps.

UIS.InputBegan:Connect(function(input, gameProcessed)
	if gameProcessed then return end
	if input.KeyCode == Enum.KeyCode.ButtonX then
		local userInputService = game:GetService("UserInputService")
		local cframe = userInputService:GetUserCFrame(Enum.UserCFrame.Head)
		print(cframe)
		local ray = camera:ViewportPointToRay(cframe.X, cframe.Y)
		ray = Ray.new(ray.Origin, ray.Direction * 200)
		local _, pos = workspace:FindPartOnRay(ray, player.Character)
		event:FireServer(pos)
	end
end)

If it’s not working then try adding a not here, because that’s saying it wont work unless a TextBox is active.

1 Like

This isnt at all the issue. Everything works fine. it just wont shoot the fireball correctly.

Sorry, I didn’t see because you didn’t reply to me. Next time, please click the Reply button. I still have no ida what your issue is, I think it may be an issue with the Server that’s handling the FireServer.