VR Expansion Plugin

Pushed a new commit to both the template and the master plugin


Updated to new branch code

Added local only grips that execute only on the client calling them (do not replicate objects using  grip)

Removed actor/component seperation in grips and made it all work off of single uobject base

( change lowers replication cost and makes the plugin more generic).

Template was able to be made more generic now due to (no actor/component switches anymore for most things).

update might have bugs that I haven’t found yet, let me know.

Should be able to work on feature sets now instead of the backend with change.

Template required blueprint changes after the plugin update, since there are no longer actor/component outputs on the grip structure it unlinks it wherever it was used and you have to link in the grippedobject instead.

I know I should just DL and try it out myself.

But I just wanted to make sure that everything was good to go (as far as you know) in concerns to actual replication for motion controllers in 4.14.2.

That’s pretty much all I would need it for really.

Thanks.


Made with your plugin!

Is there any event to call when an actor is forced out of the grip?

ie. Collides with wall / swung too fast

Did you test with KeepOriginalMovement or ForceClientSide? Because I don’t use KeepOriginalMovement on any of the objects, only ForceClientSideMovement. Maybe I didn’t understand your response entirely, just making sure.

All objects by default are ForceClientSideMovement, that is why I was confused about you running into KeepOriginalMovement being set to true. You are somehow either corrupting a struct or altering one without knowing it as even replicating an empty default struct it will be ForceClientSideMovement by default unless uninitialized (structs constructor never ran). Are you deleting objects a lot?

Nice, keep going!

Colliding with a wall bColliding should be set to true but generally I didn’t consider it because the actor/component itself will trigger an OnHit event and I didn’t see a reason to duplicate engine functionality.

Moving so fast that the object is farther than normal from the hand with physics grips there isn’t currently anything to tell you that, for the auto drop I read the constraint length and if it is too large than drop the object, I could add a function to get value if it is useful to you.

Auto drop btw calls the OnDrop event like a normal drop.

Getting crash when trying the local grip, just letting you know


MachineId:C96834D044A593A10B3F38AE029137B0
EpicAccountId:1c3b94657fc34a4a87cec5acbf729012

Access violation - code c0000005 (first/second chance not available)

UE4Editor_VRExpansionPlugin!UGripMotionControllerComponent::NotifyDrop_Implementation() [g:\unreal projects\runforcover\runforcover\plugins\-vrexpansionplugin-c3213dd8ce1e\source\vrexpansionplugin\private\gripmotioncontrollercomponent.cpp:1366]
UE4Editor_VRExpansionPlugin!UGripMotionControllerComponent::DropGrip() [g:\unreal projects\runforcover\runforcover\plugins\-vrexpansionplugin-c3213dd8ce1e\source\vrexpansionplugin\private\gripmotioncontrollercomponent.cpp:1147]
UE4Editor_VRExpansionPlugin!UGripMotionControllerComponent::DropActor() [g:\unreal projects\runforcover\runforcover\plugins\-vrexpansionplugin-c3213dd8ce1e\source\vrexpansionplugin\private\gripmotioncontrollercomponent.cpp:900]
UE4Editor_VRExpansionPlugin!UGripMotionControllerComponent::DropObject() [g:\unreal projects\runforcover\runforcover\plugins\-vrexpansionplugin-c3213dd8ce1e\source\vrexpansionplugin\private\gripmotioncontrollercomponent.cpp:586]
UE4Editor_VRExpansionPlugin!UGripMotionControllerComponent::OnUnregister() [g:\unreal projects\runforcover\runforcover\plugins\-vrexpansionplugin-c3213dd8ce1e\source\vrexpansionplugin\private\gripmotioncontrollercomponent.cpp:94]
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Core
UE4Editor_Core
UE4Editor_Core
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor
UE4Editor
UE4Editor
UE4Editor
UE4Editor
kernel32
ntdll

I’ll look into it, but could you please wrap that in code tags instead of quote so it doesn’t take the entire page?

Fixed, accidentally moved deleting a locally gripped object ahead of using it prior to deletion >.<.

Plugin and template are updated with the fix, also fixed an oversight in the template where it wasn’t checking for the locally gripped object on drop.

Works great now!

I am. Every time a player dies, I drop his weapons (so that he can’t shoot, it’s also a good indication that he died), and then I destroy them. We did some playtesting today and the assert was thrown randomly while we were just teleporting around. I am setting the members of the InterfaceProperties without an authority switch at begin play, could cause any issues?

Yeah that could possibly be an issue if it is only being set on one side, if you are resetting it to KeepOriginalMovement somehow for instance after it has already been gripped.

Like I said, the struct itself auto sets to ForceClientSideMovement when its constructor is called, the only way for it to bypass that is you to be manually setting it or somehow passing in an empty struct entirely with uninitialized values.

is AutoDrop part of the new commit you pushed out? I can’t find it in the one back a commit.

Currently whenever the player drops a key item (one that is spawned in with them, ie sword / gun / something) it attaches back to their hip.

The problem is that when my player is moving and runs into a wall / swings the weapon too fast it stops grabbing it but doesnt reset it to the hip/socket

That’s exactly why I am NOT using an auth switch on begin play, to make sure it’s set on both server and client. I am only playtesting with two grippable actors, and they have the same logic… I never change members after the initial initialization that happens on begin play.

Question: has the plugin been tested with grabbing destructible objects ?

Well that would trigger “OnDrop” on the held actor if it uses the interface. What are you looking for? An “OnAutoDrop” event on the controller itself that passes the object to drop back in? At that point it would probably be better to turn auto drop off and run your own checks, auto drop is just there for convenience.

By the way, for swords I wouldn’t suggest using a physics grip, there isn’t really a way around there being a slight offset due to the controller and the object being on different threads and if you run swords as a non interactive grip then they will feel attached to the hand instead of floaty.

Yeah I picked up some destructed objects before, you have to be able to trace them as they default to the async physics thread I believe.

Pushed a new commit to the plugin and template


Added in auto deletion of physics handles for pending kill objects,
ensured that grips are removed on pending kill objects.

Still better to manually Drop() an object prior to deleting it.  is a failsafe.

I am having the hardest time installing ? Are there any detailed instructions on how to install plugin into 4.14.1. I read the:

  1. Clone Or Download Zip and extract repository to a folder named “VRExpansionPlugin” in your “ProjectName/Plugins” directory, create directory if it is missing.

  2. Add the VRExpansionPlugin to your projects PublicDependencyModuleNames in the projects build.cs if you have c++ code included.

  3. IF you do not have c++ code, use the Add New button in the editor and add a blank c++ class to your project.

I will offer pre-compiled binaries for all builds as well eventually when the plugin is stable enough for it, but until then installing it in the project instead of the engine is better.

But for some reason, I get lost at step 2. Please help

If you have C++ code added to your project then just follow step 1 and start your project. It will ask you do you want to build, click yes let it do its stuff and you’re done. If you don’t have C++ code added then delete the plugin , start your game then add C++. Then start over at step one.

When I do step 1. I get an error that says “plugin missing or incompatible modules in VRExpansionPlugin - would you like to disable it? You will no longer be able to open any assets created using it.”

After clicking ok, another message saying

Plugin ‘VRExpansionPlugin’ failed to load because module ‘VRExpansionPlugi’ could not be found. Please ensure the plugin is properly installed, otherwise consider disable the plugin for project". Then the Unreal Engine does not open. Please advise on how to install for a block head like me.