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)