Enable VRLaserPointerMode

I’m trying to enable and disable my VRLaserPointer during certain segments of the game. I saw that I can disable it by writing: game.StarterGui:SetCore(“VRLaserPointerMode”, 0)

However, Im not sure how to enable it back. I have tried:
game.StarterGui:SetCore(“VRLaserPointerMode”, true)
game.StarterGui:SetCore(“VRLaserPointerMode”, 1)
game.StarterGui:SetCore(“VRLaserPointerMode”, 2)
game.StarterGui:SetCore(“VRLaserPointerMode”, 3)

All of these don’t work.

4 Likes

Did you mean game.StarterGui:SetCore(“VRLaserPointerMode”, true)?

3 Likes

oh yes, thanks for pointing it out. i made a typo in my post. edited!

1 Like

put in #help-and-feedback:scripting-support

I’m not aware of that function. It appears the laser is in the Camera object in workspace as well though. Isn’t it also possible to set the LocalTransparencyModifier of the parts in there to 1?

2 Likes

How did you find this function exactly?

Hi there! You can turn the laser pointer back on with
game.StarterGui:SetCore(“VRLaserPointerMode”, "Pointer")
This API definitely needs an update to better fit current patterns and documentation.

5 Likes

Late to the party, but I thought I might list these here as there’s actually 4 modes you can set VRLaserPointer to

local LaserPointerMode = {
    Disabled = 0,
    Pointer = 1,
    Navigation = 2,
    Hidden = 3
}

Found within an archive of old roblox corescripts from way back when.

We really need updated documentation on this sort of stuff. It is crucial to those developing VR related content.

Update:
It appears you can now modify VR laser pointers directly without the use of setcore; however, the enumerator excludes types "navigation " and "hidden ".

1 Like