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.
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)
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.
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?
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.
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!
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.
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!
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.