VR Expansion Plugin

Yeah no, it is definitely in the grip function, you need to pass in the transform of the actor you are gripping, not the transform of the motion controller, if you want it to snap to the controller then use a “MakeTransform” node and leave the location as 0,0,0 and tick the “Is already relative” checkbox, but you will need to fill in the Scale part of the transform with the scale of the actor you are trying to grip.

With how you currently set it up you are creating an empty transform with only a location set so it is defaulting the scale of the gripped actor to 1,1,1.

I allow it to change the scale of the gripped actor specifically because it is handy sometimes to say add a 25% scale increase to held items (papers/tablets/ect).

I have a ChildActor-component as a child to MotionController. The ChildActor is set to BP_Gun which is set to replicate, but not replicate movement (I tried replicate movement, it gave the same results).

I’ve tried setting the tick order in every way possible for the child actor, and it does the same thing. I think the problem lays with the fact that the ChildActor is it’s own actor, and since it’s set to replicate it does UE-magic and predicts it’s movement… I need BP_Gun to be replicated since it calls the server to spawn projectile etc. When Replicate is set to false the events simply aren’t, even though the parent pawn is set to replicate. It’s really halted my progress atm since I don’t want to have separate pawn classes for every weapon available.

Is it actually a gun? Like just something that you shoot? If so don’t attach it, use one of the grip functions instead, even though attaching shouldn’t be a problem in the first place.

I don’t get exactly what you are doing? I have multiple actors that I just “grip” and freely call events from, the only thing that gets modified is movement replication which doesn’t effect RCPs sending.

I don’t use any of the Grip functions that comes with the plugin. I just have the ChildActor component set up in the PlayerPawn BP, I don’t do anything at runtime with it. The RPCs are behaving as they should but the location of the BP_Gun actor is not. You can easily repro it by just making a child actor actor component and parent it to a motioncontroller. Set the selected actor to an actor that is set to replicate, and you can see it move infront of where the motioncontroller is moved.

Using the provided grip function might just work though.

If you aren’t using the grip functions, what is your reasoning for using a child actor component instead of just directly attaching an actor to the motion controller (AttachToComponent) and saving a reference to it?

Because then I would have to spawn the actor at runtime, so I usually save myself the trouble and just use a child actor component instead.

In case the behavior you want would be automatic if you use attachment instead.

I tried that and it gave me the same behaviour. I’ve tried with different BPs as well. Also, I’m no longer able to get GripActor to work, it constantly returns failed. Root component of GrippedActor is Skeletal Mesh, there is no other component attached to the MotionController component either so no issues with collision there. The exact same setup works in my 4.12.5 project. Here’s a screenshot of what I’m doing:

The console log will say why it failed to grip the object.

I didn’t even think to look there. It says that it’s always called by the client, event though I use an authority switch and specifically call event on server. Worth noticing that I’m hosting a listen server and the client I’m playing as is the host. Afaik there is no limitation to using a listen server?

I specifically check for listen servers as servers in the code for it and have tested with them.

However is not set until first tick ( is when the engines default controllers decide locally controlled as well). So I assume that your grip code is taking place during Begin Play? Which is prior to when the controllers start checking for their owning state and net state.

I can probably just set it on begin play as well (there aren’t role transitions), I think that the blueprint event for it should fire after the controllers code event. I didn’t anticipate people gripping objects prior to the players actually controlling the pawn.

Prior to a code change though you can spawn it sometime after begin play and grip, or just attach instead since you didn’t plan on using the grip functions.

I did get attach to work on begin play. I also tested to grip after begin play on player input and that worked as well with some minor interesting issues. It was resolved by checking “Generate Overlaps” on the root component of the gripped actor.

I use the vive controller mesh as the root to then align the gun against, and since a scene component can’t be the root it works with one caveat: The physics collision during grip only seems to account for the root mesh’s collision?

I can work around the issue with begin play by just adding a delay, so don’t change just because of me. Thanks!

It should be fixed anyway, but your setup is weird, a vive controller mesh is a primitive component and is fine as a root for gripping. Regardless though are you gripping the vive controller mesh and then parenting the gun to that hand? Why isn’t the hand mesh just childed to the controller and then you grip the gun directly? Your setup is pretty confusing to me right now.

You 're the man !
Thanks a lot :slight_smile:

Hello,
Any chance to share a empty scene correctly setuped?
It will help a lot newb like me.
plug/unplug and see what happens is the poor way to learn when you have a flat brain.
finger crossed.
Regards,

“soon”, i’m trying to finish some quality of life features first so I can make it as simple as possible.

Pushed new commit live from test branch, is a fairly important one as it makes certain interactions far easier to create in VR.




**10/26/2016**- Physics grips overhaul + new grip style

Overhauled the interactive physics grip, should be cleaner and more stable now, also takes root bone rotation into account now so that in 4.14 and forward gripped items always look correct (4.13 bug prevents it in there).

Added new grip style "Manipulation Grip",  grip isn't meant to pick things up, rather it is a physics constraint grip meant to be used for interacting with constrained items like doors/drawers/levers/dials/ you name it. Should make creating interactive physics based items far easier in VR.

Hi,

Having difficulty while attempting to SetControlRotation while using the VRCharacter. I understand is a UE4 bug everyone figures out their own work around for eventually, but I am hoping to get a “best practice” here. Perhaps a custom “SetControlRotation” for the VRCharacter would be possible or worthwhile?

I have “portals” which should reorient the player to face a chosen direction upon teleporting.

Warm regards,

PS Here is the issue I referred to: Unreal Engine Issues and Bug Tracker (UE-21676)

HMD rotation is based locally off of the player rotation, set the actor rotation instead.

Thanks for the follow up, I did attempt setting the player’s rotation as well and it did not work for whatever reason. I know that traditional Teleport blueprint node rotation seems to work with the VR Template 4.13/4.14 setup though, so maybe there is something I keep missing,

In any case, I came up with a solution that is working for me, I’ll post it here in hopes that it can help someone else and maybe make more clear what my issue was.