PlayerScripts.PlayerModule.CameraModule.VRBaseCamera:97: attempt to index nil with 'Connect'

I’m trying to make a vr movement system, but for some reason everytime i load in i keep getting the error in the title, it’s causing my inputs the not work, and it’s a problem with the default player module so i have no idea how to fix it

heres the full error
image

2 Likes

Let’s load up some pretext first. These are PlayerModule submodules and manage pretty much all of the player controls with camera and input.

According to those modules, the lines being targeted are:

self.gamepadResetConnection = CameraInput.gamepadReset:Connect(function()
	self:GamepadReset()
end)

Other relevant lines:

local gamepadResetBindable = VRService.VREnabled and Instance.new("BindableEvent") or nil
if VRService.VREnabled then
	CameraInput.gamepadReset = gamepadResetBindable.Event
end

After some analysis, I have no idea what you have done from your end to result in this. Could you provide more information on what code you have tried using?

Additionally, I don’t understand what is the true problem behind this. Can you elaborate if it is just an issue that does nothing significant or really a problem that cause relevant key systems to break?

1 Like

i didn’t really use any code to trigger this, i tried testing it in a brand new place with no code, and the issue persisted whenever i gave vr inputs

Hm, it could then possibly be the case the VREnabled property wasn’t enabled fast enough or something like that. Otherwise, we could have a possibility of a bug existing when testing it in Studio?