VR Expansion Plugin

Hey, hope you don’t mind giving me a hand again. I’ve tried to sort out myself for a couple days and I’m running into a wall with the slotting system. Here’s my setup in C++:


IVRGripInterface* GripInterfaceForActor = Cast<IVRGripInterface>(HitResult.GetActor());

if (GripInterfaceForActor)
{
bool bHadSlotInRangeLocal = true;
FTransform SlotTransform;
FTransform HitActorTransform = HitActor->GetActorTransform();
GripInterfaceForComp->Execute_ClosestGripSlotInRange(HitActor, RightMotionControllerLocation, false, bHadSlotInRangeLocal, SlotTransform, RightMotionController, NAME_None);

FTransform TransformForHadSlot = HitActorTransform.GetRelativeTransform(SlotTransform);
FTransform TransformForNoSlot = RightMotionController->ConvertToControllerRelativeTransform(HitActorTransform);

FTransform FinalTransform;
if (bHadSlotInRangeLocal)
{
UE_LOG(LogTemp, Warning, TEXT("Had slot in range"))
FinalTransform = TransformForHadSlot;
}

if (!bHadSlotInRangeLocal)
{
UE_LOG(LogTemp, Warning, TEXT("Didn't have slot in range"))
FinalTransform = TransformForNoSlot;
}

// FTransform CompTransform = HitResult.GetComponent()->GetComponentTransform();
RightMotionController->GripObjectByInterface(HitResult.GetComponent(), FinalTransform, false);

**The problem is that when I grip with code, the object jumps/snaps *towards *my controller for a split second, then flies away a few meters with physics instead of snapping to my hand. **I have a VRGripP1 socket set up on the grippable static mesh, and it’s inside a BP based on the GrippableActor class. I wanted to figure out myself but I thought you might be able to quickly spot my mistake. Thank you!

That quoted snippet should be TRUE for the boolean, its been made into a relative transform so it needs to be listed as already relative, otherwise the gripping function will attempt to make it relative.

Got it. Now I’m having it trip line of code every time and just grabbing it in the normal offset fashion, still not snapping to the controller:



if (!bHadSlotInRangeLocal) { UE_LOG(LogTemp, Warning, TEXT("Didn't have slot in range")) FinalTransform = TransformForNoSlot; }

I have the slot range set in the grippable object’s BP to 200 so it’s well over far enough to be triggered. Slot Default Grip Type is however set to Interactive Collision With Physics, should that be something else? I’ll keep chipping away but if you think of anything else that could be wrong it’d be much appreciated

EDIT: Never mind, my BP instance was overriding it the pick up range variable PrimarySlotRange. Will leave up for anyone else having the same problem. Sorry for the mistake! You’re the best

Hi - new question: I see in the ‘Can Object Be Climbed’ function in Vive Pawn Character there is a ‘Get Collision Response To Channel ECC_GameTraceChannel1’ - what is ? I can’t find it defined in project settings. The effect is that I can climb on my enemy actor capsules which is super odd and not compatible with the ideas I have for my game :slight_smile:

Hello,
Firstly thank you so much for making free.
I feel like I am really late to the party lol.

I am in the midst of creating my first VR game and plugin is a life saver!

It is very early days yet, but I would like to send a copy when complete to you for review purposes lol

Is it ok to ask for tiny bits of guidance here?

I hope its ok,

I’m trying to create a weapon holster. So when you find a weapon and pick it up, it activates a sci-fi style holster, so that when you drop it it teleports into a holster. (I’ve got that bit working)
The issue I’m having is, I can then re-pickup the weapon again and carry on using it the first time, but then it goes mental. It shoots the floor and disappears lol.

Any suggestions? I’ve just deleted it all to start it again but it has happened a number of times now.

I hope its ok to ask for suggestions here.

Thanks again

Sounds like you didn’t port the VRTraceChannel, I believe that is supposed to be a check against that. Just override that function though in your subclass and filter however you want for what is climbable and what isn’t. You aren’t really supposed to use the default implementation as it doesn’t really throw much out.

Sounds like you are physically gripping it, getting it stuck on fire, and it gets enough inpulse that it gets shot out of your hand? Im unsure as I don’t know what all you have going on behind the scene here with your gun class.

Do you know anywhere that I can find more out about ? I am Stuck lol.
Thanks for replying on the post quoted, It gives me more avenues to research :slight_smile:

Look at the gunbase on the left hand side in the blueprint editor there is an interface function override for the WantsToSocket function, the object tells the hand on release if it wants to slot into anything. I would SS it for you but I am compiling 4.26 again.

You can also manually call DropAndSocket to drop it and attach it to anything that you want, the WantsToSocket pathway is just the default OnRelease method.

Hi,
I want to make a game where you can walk inside of moving vehicles.
Can I just attach the character to them or need I to keep some things in mind?
(If it’s already discussed somewhere a link would be appreciated because I can’t find anything helpful)

as long as it can be treated as a movement base than characters should just work for that in walking movement mode.

Hey , sorry to bother you again. Quick question: could my VRGripinterface settings or something else like complex/simple trace to detect overlapping objects on the hands be the cause of a SKELETAL grippable mesh not working for me? I switch it out to a static grippable and it works fine with my setup, but when using the skeletal version I don’t even get an overlap detected by my hands. None of my collision settings on the mesh component differ between when it is working and not. Any ideas? Thank you

I was trying to make these hand collisions to not show up in the game view. I tried to hide in game mode and I have it checked off where it is not visible but its still there. how would I fix ?

I’m not the resident expert, but I’ll take a stab haha. The least I can do to make up for all my questions.

First thoughts:

  1. If you have pawn placed in-world as a BP instance, you should delete it and place it again. A lot of times my BP instances don’t like changes and will ignore updates to the actual blueprint base.
  2. If you’re using C++, you might have left them set to visible in game in there.

FIXED!

I’ll post for anyone else having my particular problem: there were a few things working against me (me, myself, and I). My skeletal mesh .fbx had bones too small for it to auto-produce a physics asset upon import so there was nothing for my hands to actually overlap with :rolleyes: Secondly, I was testing for the ACTOR I hit with the line trace to see if it had a VR Grip Interface, but I was not using a grippable actor! Instead, I was using a regular actor with a grippable skeletal mesh COMPONENT, so I needed to be checking for the COMPONENT struck by the line-trace to see if it had a Grip Interface.

Change the “hidden” variable on them, by default collision shapes don’t render but I ticked on their debug drawing to let people visualize how it handles it.

Thank you so much, I dont understand it yet, but I now see where to hunt and learn.

Thank you :slight_smile:

My apologies btw, its called RequestsSocketing, I was working off of memory as I was updating my computer at the time.

How well does VRE work with assets from the Unreal Marketplace that are designed for the stock Unreal VR system, like VR Hands? (VR Immersive Hands v2_3 in Blueprints - UE Marketplace)
I’m guessing that’s more trouble than it’s worth, since they’re not designed for the VRE framework, but am curious, as I’m just going through the Fall sale right now and seeing if anything would be useful. Thanks!

It may require some porting if you don’t want to use their gripping setup, but everything else should just work out of the box assuming that they designed their pack correctly. VRE is designed so that the heavy stuff is back end, but all of the control of it is front end and directly changeable by the end user, you don’t really have any limits on merging other content in to it other than your ability to grasp how to do so.

Hello .
Again about controllers input smoothing. We want to smooth input when one hand holding object. Now it’s jittering a little but constant and holding still with two grips. I found smoothing in GripScripts but it works only when two grips holding object. Tried to override it with our GS but can’t figure out how to do .
Thanks.