[VIVE] - and probably occulus - VR intereractable physic objects

Hi guys

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 ***


PO_1.jpg

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 ***


SL_2.jpg

SL_1.jpg

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 ***


49fe93bb953f2ab69e02878048996cb63c864859.jpeg

38490eaa2f60bab1b7754086491735e44da2b26c.jpeg

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 :wink:

enjoy guys.

Quite an amazing amount of very useful stuff, thanks for sharing :slight_smile:

you’re welcome :wink:

any feedbacks ?

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 .

i will give you my feedback when i test them .

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?

Hi,

I’ve had a little play with this, just trying the basics and then getting it into another project.

  1. The base system in your template is excellent!

  2. 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.

  3. 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.

  4. 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).

Hi guys,

thanks for the feedbacks

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.

Thank you for the response. I will spend some time with it over the weekend.

I will test it out over the weekend and give you some feedback.

Hi jamis,

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?

Hi guys,

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 :wink:

  • your mesh has to be modeled Z-up and with its pivot point centered to the world
    a1112b807b8c70d01daff3723037c80f3c3fbc94.jpeg

  • import in the engine
    200add16bacb879fab631aee223bafbb791ede49.jpeg

  • 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

  • drop a blanck BP_InteractableActor in your scene

  • select the type of motion (rotation or translation)

  • set wich mesh/material will be used by the interactable actor
    61d877f8c42916fd6a90a4ad90fff90460a2df89.jpeg
    44f3c85c80ba9203a43735e3c9ff8aea2c845f58.jpeg

  • in case of a rotation : the red arrow is for the rotation axis, the blue arrow is the default position, and the green one is the limit position
    ef2ffcb58f67a4c7e9b27a5c475b03ed0e6efb8a.jpeg

  • in case of a translation : the blue arrow is for the translation axis, the red arrow is the default position, and the green one is the limit position
    31ad48419aa6e96a32cc8e8fc2a808a26e40be1b.jpeg

  • if the limit is set to zero : no limit

  • if rotation the limit is expressed in °, if translation limit is expressed in cm.

auto return and physic feature are pretty much self explanatory

I’ll make another wuick tuto for the linked and attached to feature :wink:

I hope it’s gonna make things easier to figure out.

cheer guys

Thanks for the info, will take another look at it.

Great Stuff, I am just getting my head around it. But keep up the great work mate.

Sorry for my naive knowledge of blueprints, but is there an easy way to set a triggered off event when a lever reaches the maximum amount?

Just wonder if can do rotation and location motion at the same time ?

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.

I would like both pickup and interactive object can be locked. but the package missing pickup object to be lockable.

I am trying to incorporate standard gamepad joystick movement (I am using oculus touch). Any idea what the best route to go with this is?

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