Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

VR Button - Unreal Engine 5

Pushing my VR buttons >:(

So I chose to create the VR button (and lever, but this will be a separate post), as one of my five options. When I first began this University project i started with using Unity. I had quite a few problems and lack of tutorials and easy access to learning for Unity compared to Unreal made me decide to switch over. 

I had made multiple attempts at this task and wasn't successful, I finally found a good tutorial and got one created but wanted to list some problems I had and talk through how and why they did and more reasons for the switch from Unity.

Nodes! - so a major reason I switched over was the fact Unreal 5 was nodes, So Nodes make my life a lot easier as I use other apps that are built around nodes (Such as Blender, which has Nodes that function a different way but have the same theory behind them which made it so much easier for me to understand) The nodes within Unreal 5 are very clear and easily laid out, I did struggle with them at first but there is so many resources online to learn the function and how to create particular things and after the main hitch in the road I was actually able to create my button.

Lack of resources for Unity - Another big reason was the lack of resources (and my understanding for most things Unity) compared to Unreal, this was mainly due to the amount of resources online. Such as on YouTube there is multiple channels that dedicate themselves to VR building for Unreal where as most Unity channels are either hidden or want you to use addons which I have tried and failed to successfully use as there is multiple layers and other addons needed for the main ones to function, whereas Unreal mainly focuses on the usage of their nodes and has a node for pretty much everything with the ability to add or create more.

Anyways those were some of the main reasons and problems behind my switch, But moving onto my button and the creation of it, So i began by creating a 3D model for a button and create some coding on a construction graph to assign my button offset (how far the button will go down)

This was probably the easiest part of the whole button, it consists of making sure the arrow and button offset will control the stopping location of the "static mesh" which was the main body of my button.

The next part was my event graph which was the part that would control the main functions of the button and create the smooth down motion when you press it. On this graph you can also add a function to your button, I haven't yet done this but plan to after creating more parts for my project to make sure I have 5 parts that at least partially function due to the main struggle with the project and it taking me a long time to create this button.

The event graph was mainly to control the up and down function of the button, The first part i had to create was the motion to allow the user to push the button itself. I started with the event tick and added a branch with a condition to make sure the length didn't extend past the arrow I have added. This would stop the button at the right point and not allow it to push down forever. I then added the function for the button to move down by taking the component location and subtracting an amount it can move the static mesh to. The other part of the button was adding the function for it to retract back to its original location, which was the same order of nodes but using the add function instead of the subtract one. This allows the function of the button to be pushed and retract with a collision object, Which moved me onto making the VRpawn (the VR character you play as during simulation) have collision objects as hands so you can push the button with the motion controllers.

This was quite simple by opening the blueprint Unreal has automatically of VRpawn, and adding to each hand a sphere collision object, I also had to resize them to make sure they fit a good hand size for the button to be pushed easily and make the user feel more immersed within the game.


After all this it was time to test the project which I had to open SteamVR and the meta quest app and connect my Headset to my PC. The Button works and functions, I will need to go back and add a function to this button later on but i like how this has come out.

https://drive.google.com/file/d/1V_THYzWHkLutIa81PtCJ1vj0bgUKBCNR/view?usp=shari...

Support this post

Did you like this post? Tell us

Leave a comment

Log in with your itch.io account to leave a comment.