[Open Source] EasyVR | Module to help making VR games easier

Hello Developers!

Recently I’ve been looking around for games that use VR but was disappointed to the lack of games that explored outside the “Social Sandbox” genre so I decided to create this module named “EasyVR” which is a simple module that allows you developers to create VR games without having to worry about the complicated backend stuff. I hope to see what you create!

Please note this is my first time experimenting with the VR Service and ModuleScripts so if you find any bugs or issues please reply to this post with the bug or issue and I’ll try my best to fix it.

Links

Module Source Code
Example RBXM FIie
Documentation

Updates

  • 3/24/2021
    • Fixed instance attaching
    • Improved Relative axis movement
    • Added Rumbe function

Example

local User = require(script:WaitForChild("EasyVR")) --Require the module

local TestHat = game.Workspace:WaitForChild("ValkyrieHelm")

User.Create() --Create head and hands
User.AttachInstance("Head", TestHat) --Attach a instance to User (Part, Union, MeshPart or Model)
User.Run() --Run User (Hand movement and Head movement, etc)

User.ButtonPressed(function(Button) --Click a button on the controllers
	if Button == Enum.KeyCode.ButtonX then
		print("Button Pressed")
	end
end)
User.ButtonReleased(function(Button) --Release a button on the controllers
	if Button == Enum.KeyCode.ButtonX then
		print("Button Released")
	end
end)
User.SetMovementAxis("Relative") --What axis the User moves on (Recommend relative)
User.ThumbstickMoved(function(Thumbstick, X, Y) --Return thumbstick and x, y positions when moved.
	print(Thumbstick, X, Y)
end)

User.DebugMode(true) --Turns on debug mode (Allows you to see hands)
User.DisableUI() --Disable Core GUI / VR UI (Pointers, Teleporter, etc)
37 Likes

I know this is a dumb question and the answer will probably be no, but is there any way to test if the VR Mode works without owning a VR?

2 Likes

I have seen a sort of “VR Emulator” a while back that used 2 mice and a keyboard, but I don’t know if it is released yet and I don’t even know where to find it.

2 Likes

No sorry, the VR module requires a VR Headset to actually work and develop games with.

2 Likes

Thank you for making this. I will probably use parts of the source code as i am actively coding a vr module specifically fitted for my game. But i must ask. Did you find a way to get around the 0.1-0.5 second delay when pressing a key?

I’ve never experienced any delay when pressing any buttons on the controller.

Sorry I was moreso referring to triggers. Not like x, y.

I’ve developed a lot xbox support wise, does this keycode work with VR controllers too? From what I know ButtonX refers to the x button on a gamepad… :confused:

Correct me if I am wrong, I am just curious because I have never developed with VR.

2 Likes

My oculus quest 2 has a X button but some other controllers may not have a X button. It doesn’t matter anyways as it’s just a example, the function returns the enum of any button pressed.

1 Like

Hey! I’m aware this is an old topic, but modules for VR are few and far between, especially well built and customizable ones.
I’ve picked up this module but I have a few problems.

#1: This is mainly feedback, but I’ve had to do a few fixes that you may want to update/account for if you still care to update the module. These specifically are:

  • The documentation refers to each “hand” as “LeftArm” and “RightArm” respectively. The same goes for the example project. However, the module itself refers to these as “LeftHand” and “RightHand,” meaning a few minor fixes need to be made in documentation and example project.
  • In AttachInstance, the Module attempts to check for Part.Name when it fails to properly find a hand or head to attach to, when it should just check Part, since Part is a string
  • The documentation fails to mention an empty StarterCharacter must be made to override basic player movement and other default functions

#2: A few bugs I’ve found that I need assistance fixing…

  • The head, instead of rotating around itself when the player moves their head, rotates around their origin (somewhere around their feet) meaning that when you look up or down, your character appears to lean forward or backward, even going through the floor eventually.
  • Movement seems very buggy, you move faster when you move left and right compared to forward and back, and when the move direction is set to “Relative” the movement seems to bug out quite a bit.
  • Hands seem to float above the head, instead of where they realistically would be.

If I could get some assistance figuring out these bugs, that would be great! And thanks for the module, super helpful!

3 Likes

Hey there,

Thanks for providing feedback on my VR Module. The project has currently been discontinued so I won’t be pursuing the bugs to fix. This is due to other modules such as Nexus VR being a better alternative. At the time my module provided much more customizability then others and that’s why I decided to open source it though that has changed now. Either way I do personally recommend other modules now though I may come back to the project eventually. Regrading the movement bug though for the relative axis, I am assuming that something has changed on Roblox’s side to cause that as at the time I never experienced the things you stated.

Though thanks for your feedback and like stated above I may work on it again when I have the time.

1 Like

Sadly, no. I tried using a phone plugged into my computer and all it did was charge, not go into vr mode. If you know a way to do that right then please tell me!

1 Like

Interesting, I’ll have to check it out! Let’s see if it works with my melee system. I’d promote this on that post as well if it does. It was designed for Nexus support but I’d like to see how it works with other methods.

How interesting. I was literally just thinking this!

This I why I am making a sword-fighting fantasy VR game. I’ll tell you when I’m done.

1 Like

Try this one that I made, it requires two players though.

https://www.roblox.com/games/5606710828/VR-Sword-Fighting-Simulator-Beta

This one also looks fun and it was made by the same people that made Obby Creator: https://www.roblox.com/games/4978277576/VR-Invasion

If you want any examples or help with that, let me know! Seems pretty interesting.

The hack still exists, probably patched tho I’ll try finding a vr emulator and reinstall windows along the way

1 Like

I wasn’t really talking about a hack, it was an application I saw a long time ago for windows that would just run steamvr with your kb and mouse

But yeah that works too I guess

I’ll try finding one for it might find it

1 Like

No app found, I found a hack but obviously I can’t post it here you can search for it yourself but yeah hacking is against TOS

I might just buy a Google cardboard

1 Like