VR Expansion Plugin

ok cool. I’ll tweak the replication and lerp as required. Thanks again.

When working with secondary grips, is it possible to not have the event Secondary Grip Released ***not ***fire when the main grip is released? I’m attempting to create a tape measure where you can drop the body of the device on a surface while maintaining the secondary grip to allow for the rendering of the tape. Currently the road-block I’ve hit is that when releasing the tape body the Secondary Grip Released event is triggered, causing the tape to self-destruct. Any thoughts?

Not really, SecondaryGrip is a grip modifier, when you drop the grip itself then the secondary grip modifier is removed. Normally for that tape setup I would have a seperate component on the tape end of the tape measure that the other hand grips, not a secondary grip. That way you can pull out the other end of the tape seperate from the main body.

Trying to do it with a secondary grip seems like the wrong approach there, two seperate grips (one of the body and one of the tape end as a component) seems more suitable?

You could also store the secondary hand and not implement a secondary grip at all if you wanted to avoid the extra component, the secondary attachment itself really doesn’t have much use with what you are trying to make there.

I just want to thank you so much for giving us amazing public, you have saved me so much time with doing my own research and now I can get straight to work and making my ideas come to life. One of my ideas were to have weighted physics objects that you can grab as seen in games live Blade and Sorcery or the unreleased Boneworks. Is there a way to do that through your implimentation of the grabbing mechanics?

Yes, using the Interactive Collision With Physics grip type is a constraint based grip, you can pass in specific bone names to it and it will grip at that specific bone. Also in the advanced physics options on the grip struct there is the capability to change the grip type from an acceleration based constraint to a force based one, which will give more realistic behavior with that kind of thing.

https://i.imgur.com/SE1E7xN.png

These are the physics settings that you would likely want to use for that kind of thing:

https://i.imgur.com/2bkSX6V.png

You then have to play with the grip stiffness (and/or the custom angular values) until you get a force amount that works well for you.
It sets the physics grip location to stop setting the center of mass since you want the object to be weighted correctly and turns the constraint type into a force based one. Keep in mind that Angular stiffness and damping will likely have to be a very high values as its units are different than the linear stiffness ones.

You may want to actually turn on setting the COM again if you are gripping something like a sword as it would make the pivot work better.

You can grip the same object multiple times with physics grips since they are force applicators, I actually have it on my TODO list for today to make it easier to manage multiple main grips on a single object, been pushing it off because its going to require people to re-factor a bit.

I had a suspicion that I was misunderstanding the purpose of the secondary grip, thank you for clearing that up for me!

As a follow-up question, how would I go about differentiating between grips on the separate grippable components? At the moment I have one parent GrippableSphere component with a GrippableBox component where the tape end of the tape measure is. I’ve implemented the VRGrip interface to get access to the On Grip event, but how do I know which component was gripped?

Generally the best method is to have your sub component have a method of notifying the parent, like an event that you throw from it OnGrip that the parent binds too. I don’t have default ones because generally sub objects parent containers don’t care if their children are gripped or not.

There is also the OnChildGripped event that is part of the interface as a quick way of doing , but it requires checking against the sub components. It would do if you only have one child that is grippable though as you can just cast to it and use it.

Generally by the way I would have used as grippable static mesh actor for the base, and then the end of the tape could be your grippable box. Also if you are only doing linear measuring you could use a VRSlider component to extend the tape.

Thank you again , that worked perfectly! Your suggestion to change to a static mesh grippable was a great idea, and we now have a working tape measure!

Pushed a new update to both Repositories, keep in mind that one will require some actual node changes.
I usually try and keep that kind of update to between engine versions, but it is early on in 4.22 and I really wanted to work with over the course of engine version.



Changed the IsHeld Implementation and added AllowsMultiGrip to the VRGripInterface to prepare for some future features.

See Patch Notes:
https://vreue4.com/patch-notes?section=multi-grip-changes-04-18-19

Ok so I have an update!

I’ve gotten replication to work except that my client seems to be taking input from the server every other frame resulting in flickering. Not sure what I’m doing wrong, but will keep working at it and post here with the solution for others.

Attaching my code in case anyone can provide an answer.

Ug…those really should be passing / returning an array of values. I wasn’t very happy about them breaking them out per finger like that when an index map would work just as well.

When I eventually make my hard coded replication i’ll be replicating them as a 0-1 scaler since it takes significantly less bandwidth.

As for your “flickering” issue, you need to ignore the “tell client” part on the owning client as its re-setting the client by not ignoring it. Also should all be on a replicated struct or something and not multicast RPCs.

Ok. I don’t know how to work with structs yet but I’ll research those when I solve . Thank you for your help.

As for the flickering. I’ll try to figure out how to get the owning client to not fire the “Tell Client” event. I figured I could do something the attached picture, but depending on whether I choose “true” or “false” it either has no effect (keeps flickering between server and client input), or the server takes over input completely and I get full mimic instead of flickering.

Sorry for taking up so much of your time. You’ve been amazingly helpful.

edit: I also tried: get reference to self -> get controller -> is Local Controller

You want to check IsLocallyControlled on the TellClients multicast (On the received end) and ignore it, not on the actual call server side.

Hey,

I used plugin on my project but my characters head can still go through objects? How do you properly set up the VR Character so that it collides with all objects?

Thanks

It collides with static objects by default, you need to manage other collision channels yourself as to which ones it should collide with and which ones it shouldn’t.

Pushed a new patch live to both repo’s that adds a Flight Stick mode to the VRLever, patch notes linked below:

https://vreue4.com/patch-notes?section=flight-stick-mode-for-vrlever

I’m trying to play the grab animation even when there is nothing to grab. Sounds pretty straightforward but i’m having a difficult time.

Originally I tried to set the hand state in the pawn, when that had no effect i tried to set the animation like … still no effect, where can I set the grip state? is there an easy way to do ? thanks for the plugin !

update: I found where you can switch animation modes to from blueprints to anim states so that code works now but it doesn’t transition.

I didn’t have any hand animations or copywrite free hands so I just copied Epics setup over for people that were used to it anyway. The CheckAndHandleGripAnimations functions checks for current overlap state and/or gripping state and assigns an enum value in the AnimBP to control the current hand animation.

Hi. mordental
It’s a little far from the question of VR Expansion Plugin, but would you mind if I ask you a question?

I am currently developing a Physics-based VR Melee System.(Currently I am not using the VR Expansion Plugin.)
Physical handling is performed based on the PhysicshandleComponent, but if you grab and swing a thin collision’s Sword quickly, the Hit does not occur and just passes through.
VR Expansion Plugin confirmed that problem does not occur. How did you approach it and solve it?

I don’t, that is just hull penetration, you would have to adjust your physics settings or manage the collision body better.