VR Sandbox (opensourced place-file)

Just as the title says, this is a vr sandbox.
Designed for single-player physics. multiplayer does exist, just not fully supported.

Play the sandbox here:
https://www.roblox.com/games/7970868735/VR-Sandbox

I am including a place file of the base coding for the game so more people can make vr games like sked or vr hands.

Quick note: when first playing the demo you will be forced into vr mode (even without
a vr headset). This is due to a variable in the local script (this can be found in starterplayerscripts) called pcdebug at the top, set this to false for normal non vr playing.

vr god.rbxl (155.5 KB)

30 Likes

Hey i was just looking at your place and I was wondering is there any way to make a “Grabbable” item?

1 Like

Detect when the players grip/ trigger button goes past a certain threshold, and when it does fire a remote event telling the server that the grip button is down.

From the server you weld the object (or apply a continuous force) to the hand.

Note: welding probably isn’t the best solution since the body relys on network ownership, but this shouldn’t be an issue if you set the objects network owner to the player.

1 Like

Quick question could the server tell if the players vr hand touches a certain object so I could weld it to the hand or something

function GetTouchingParts(Part)
	local Connection = Part.Touched:Connect(function() end)
	local Touching = Part:GetTouchingParts()
	
	return Touching
end

A function like this should get anything inside/touching the part. If you use this code make sure to have a separate hitbox (preferably a sphere at the tip of the hand), just so the player doesn’t grab objects from the very back of the hand.

Another solution is to loop through every part / player and check to see if they’re close enough (though this could create some performance issues with a lot of players/parts).

3 Likes

Hi, love the demo. Big question, things like keyboard don’t seem to work. I’m an oculus rift s user, and none of the buttons seem to actually click anything on the keyboard. Triggers and grip doesnt work, either. Know anything about this?

Thanks one more question I made a tutorial with this place (I credited you) I made an adjustment that If VRenabled is false it destroys the scripts for VR and the people not on VR cannot see VR players could you give me any pointers on why this may be?

I didn’t include gripping or the keyboard in the place file.
Gripping wasn’t originally in the base coding and the keyboard was custom code that I’m still working out.

It’s pretty buggy so it’s definitely not going to be getting releases for awhile
roblox vr chat - YouTube more information on the kb

Also if you were talking about the game and not the place-file then I have no idea what to say.

This is already done within the first few lines of the local script
Screenshot 2021-11-24 210109

Are you able to send a video / screenshot of this bug happening?

I’ll ask the person who brought up the issue

Somebody found it a way to fix one of the issues where it works in roblox studio but not in normal roblox. I did tell him it was not my script btw.

What about VR Climbing because I’ve been trying to make VR Climbing for that past day and still haven’t figured it out. Do you have an idea on how to do it?

1 Like

Aight thanks this will help a lot. Im making a tutorial series off this.

I could attempt to help you with that I’m making tutorials on how to do a lot of these things

1 Like

Thank you, for that past entire week I’ve been trying to make it and yet haven’t figured it out.

1 Like

Heres a link to my channel I’ll try and figure this out in the next video CullisPlays - YouTube

1 Like

Alright, many people have told me to use Align Position’s with the Reaction Force property enabled. But every time I try that it either ends up with me flying or just does nothing.

Talking about gripping, I recently encountered your VR modules, and I really liked them! They were easy to edit and I decided to experiment on it.

I decided to go by myself and add a grip feature, it was mapped for Oculus Quest 2 controllers but might work for other devices. I also added a trigger input for specific items like a Soda can and I added hit detection for the VR arms.

The method I used to do those inputs are really mediocre though… but it gets the job done!

Here is the uncopylocked place:
https://www.roblox.com/games/8246143357/VR-Test-Place

I won’t do any tutorial on how to use my scripts in the place as I am way to lazy to do it. You can easily figure out how to edit the script by taking a look at it.

4 Likes

I’m not the best scripter but maybe you could use a system like whenever the climb button is down it checks to see if your touching a climable wall or part and puts an anchored part there and welds to the hand until the button input stops.

1 Like

That part I figured out, but that part I’ve been struggling on is actually making my entire body move and be able to actually “climb”. And to be able to lift myself up ledges.