let me introduce that little pack I’ve worked on. It’s an essential kit of basic VR mechanisms, compatible with Epic VR template.
it is composed of 3 customizable blueprints :
interactable physically simulated objects (can be used for door, drawers, levers, chests etc …)
slots (usable for any kind of locks)
pickables objects (can be use as keys, coins, gear etc … they fit into slots to unlock the interactable objects.
here a little demo on how it works
feature list :
*** BP_PickupObject actor ***
Similar to epic’s BP_PickupCube actor but with additional features.
can be place in a slot
has a “type” variable picked up from the enumeration “ENUM_PickupObjectType”
If the type of the PickedupObject doesn’t match the “type” of the slot he’s dropped on, it won’t collide and fallto the ground.
has a “ID” integer variable
If the type matches but not the ID, the PickupObject will be place into the slot (aligning its pivot to the slot’s pivot) but the slot will remain “locked”(slot’s “Locked” variable is still set to true)
If Both ID and type match, PickupObject will be place into the slot (aligning its pivot to the slot’s pivot) and the slot will be “unlocked”(slot’s “Locked” variable is still set to false
*** BP_Slot actor ***
actor with a customizable apparence (static mesh component), Slot can hold BP_PickupObject.
has a “Full” boolean variable set to true when it contains an object
has a “type” variable picked up from the enumeration “ENUM_PickupObjectType”
has a “ID” integer variable
*** BP_InteractableObject actor ***
Gameplay related actor with a customizable apparence (static mesh component), they can rotate or translate, be physically simulated, have a limited or unlimited range of motion etc …
“type” from “ENUM_InteractableActorType”, currently can do 1 rotation or 1 translation
“Limit” defines how far the object can move, can be positive or negative (affect the direction), if type is rotation, limite can be more then 360° or less then -360°, in that case, the object can do multiple turns. If set to 0, the range of motion is unlimited.
“Snap when closed” use this to prevent object from bouncing when returning to initial position (both by autoreturn or by hand), it alos prevent an object from pushed by a dynamic object.
“Snap Limit” how far the magnetism from the snap feature extend, expressed in % (usually less then 10%)
“Is Physic” if checked the object is physically simulated, otherwise it isn’t (when release the object stay in place)
“damping” define the damping if the object is physic
“Autoreturn” if checked, the object will return to its initial position when released
“Return Duration” defines the speed of the return, in second for a full motion (from position to initial position), if object isn’t limited the duration is base on 100 cm or 360°.
“Return Delay” defines hos long it takes for the autoreturn to start once the object is released (in second)
“Linked to” Interactable object can be linked to slot or other interactable object, in that case it read the “locked” state of all their linked objects, if at least one of them is set to true, the object cannont be grabbed or move, neither by hand or simulated. if the autoreturn is true, it will be activated immediatly.
“Attached Object” slots or other non dynamic Blueprint objects can be parented to the interactable actor. Note that it CAN’T be another interactable actor Neither a simple static mesh (a simple blueprint with a static mesh component will work perfectly.
it was supposed to be for the marketplace but it didn’t pass the quality check, so instead of let it die somewhere on my HD, I prefer to share it with the community,
feel free to use it, share it, modify it, enjoy it
if you think it could have been designed in a more efficient way, please let discuss it here, I always appreciate to learn more !
if you use it in your project, a little credit is always appreciated
That’s a lot of work you put there , thanks a lot for sharing i am currently working on different project but if i work in VR i will defiantly use most of your mechanic .
This looks like what I have been looking for a while. I will check it out when I got some time.
I am currently using the open VR plugin, it works and allows physics constraints to be used with VR interaction.
However the plugin is a little heavy for my requirements. Your project looks much more light weight.
Why did it not pass quality checks if you don’t mind me asking?
I’ve had a little play with this, just trying the basics and then getting it into another project.
The base system in your template is excellent!
But! It’s missing the normal pickup object from the template, I can only find yours. I added in one BP_Slot with an ID of 1 and two BP_PickupObjects (your version) with ID of 0 and 1. I expected only the item with the same ID (1) to snap, but they both did. Whats the solution if I want to use a normal pickup item from the standard template and don’t want it to snap. I can’t see an option to do this. I don’t want every item I create to snap to a slot.
So, I setup a standard template from the launcher, added your project on top of it. Now the standard pickup object from the base template is there, but I can’t pick it up now. It doesn’t attach, I can only push it around when trigger is pressed.
I think this should have been bolted on top of the normal template, some helpful things are deleted (the standard motioncontroller map for example as well as the standard pickupobject). Because of the missing items, this can’t function on its own, and it has problems when its merged on top of the standard VR template.
I fixed the item always snapping problem with a simple bool added to pickup and drop. It should be easier to merge with a standard template now, I’m going to test that out.
EDIT: Yes it merges fine, the standard pickup item works, but that doesn’t matter now with the new bool on your version (cuts down on the amount of different objects to be placed in the scene).
various reasons, some I could easily fix (naming convention, non PBR materials), but the main one is that epic said “to easy to reproduce” … (wich is a shame because I saw far simpler blueprints in the marketplace … but I assume they have been submitted when the market needed to be filled up …
hey… read carefully the description :
in another words if the item type’s is “Key” and the slot wait for a “key” item, the item will snap, regardless its ID, in addition, if ID’s of the slot and the item match, the slot variable “locked” will be set to false
(you can add custom types by editing the corresponding ENUM
regular pickup objects from epic template should be pickable too … they are not included in the package… because this is the way epic want stuff to be submitted to the marketplace.
be carefull using the default VR template from epic… you may run into issues if you swap objects from my package from one hand to another. this is caused by the way the checks before firing the grab and drop event are done in their player controller… those checks have to be adapted… I recommend to have a look at the modification I made in the player controller and the motion controller.
or if you don’t want to bother… just migrate the pickup object from epic template into a new project created from the template I’ve provided.
Hey, thanks for the reply, I read all of this and then started playing and it slipped my mind completely!
I imported your version on top of the template and overwrote files, I’ve checked the differences and it seems I have your version instead of Epic’s standard one!
The system for interacting with stuff really is excellent! I’m still playing but will definitely get back to you once I do.
I just tested out the examples, they feel and work very good.
I started to create my own custom interaction, so I created the BP_InteractibleActor, then I was a little lost after that point.
Could not work out how to enable the physics and constraints?
yeah, I can imagine it’s a bit confusion. my plan was to make a tutorial video for the marketplace… but for now we should go for some screenshots
your mesh has to be modeled Z-up and with its pivot point centered to the world
import in the engine
in order to be grabbed, your mesh must have a colision mesh. Custom collisions are probably the best way to go, but you can give a try to the auto collision mesh generation
Great stuff Jamis!!
A real life and time saver!
One question, maybe its a dumb question but here goes, what if i would like to only be able to grab the door handle and not the whole door to open it?
Jamis, you could likely get your package approved if you wrapped your objects into a framework or base system for interaction. I think their problem was likely that each object is separately coded for interaction.
Hello Jamis,
is it possible that you can make this new Function:
with perhaps push “E” or push directly to a door we can go inside (i mean with VR) into a Flying Object (Airplane or SpaceShip or something else) or a Car? The Goal is, that we can with VR into a Car and drive this Car in VR and then we go outside this Car and can walk again.
This is only a Dream from me… I don’t know if this is possible.
Kind regards,
halobungie