VR Expansion Plugin

Is it possible to limit the movement of a gripable static mesh actor to a specific vector. I.E hold a pool cue, and you only want the player to be able to move the cue along the forward vector of the cue when shooting to stop it from straying to the side while shooting

Yes, in 4.20+ you can use the Interactible Settings grip script and turn it on to live restrict movement, or you can switch grip modes while gripping to a CustomGrip and manually apply the restrictions.

Havent watched your overview on how to use grip scrips yet but is what i have so far, rather dirty.
It dosnt seem to want to switch to custom grip on the fly,
Video of it : https://youtu.be/obecpmkwkdM

https://.bitbucket.io/VRExpansionPlugin/VR/GripMotionControllerComponent/nodes/SetGripCollisionType.html

Use that node and set it to custom, then run the logic in EventGripTick and don’t tick the actor itself (grip tick is always after the motion controller and doesn’t require the extra actor tick to be enabled). You can still access the GripInfo as well to get where the expected relative position is for the grip.

Like I said though, if you are in 4.20+ you can make a grip script that does directly, and just flip a bool on the script.

Yea seems like the scripts are the way to go, but after messing with it i found a couple problems(Probably me doing it wrong). Firstly the intractable script limits apply to the actor world axis rather than the child static mesh so limiting it on X an Y dosnt allow the cue to only move along the relative Z axis of its length. And for some reason if i use a script on it, afterwards the secondary grip function no longer works, ive tried reverting the whole BP back to its initial state but it still wont function.

The axis limiting is a world transform override for the interactible script, I forgot that I didn’t have it as a modifier.

Regardless making your own grip script for it would be best, You can create a BP class from (base grip script BP), set its type to “ModifyTransform” and then clamp the movement as you wish when active. Same basic logic as custom grips except cleaner since it is toggled at will, can be added to any object, and just works with any of the grip types.

Hi!

Thanks for the Plugin, I’ve put it to quite some use but currently I am having issues with Widget controlling. By default, widget buttons are used with Trigger button but I would need to change it so, that it can be controlled with Trackpad Up (Face Button 1). I went deep into and found (screenshot) that the issue is in BP_Teleport_Controller > If Over Widget Use and specifically there in Widget Interaction > Is Over Intractable Widget which is always false, when other button that Trigger is used. Help would be appreciated, how can I change it so that widget can be triggered with other button than the default Trigger controller. Many thanks!

That doesn’t have anything to do with the button that is used, its just calling a utility function TriggerGripOrDrop from whatever the keybinding currently is. Then that utility function checks IsOverWidgetUse is valued true or not, you may have missed sending in the boolean stating the value of the input though (true/false)?

I’ll note that in the current template it does also use IsOverFocusableWidget as the webbrowserwidget doesn’t match IsOverInteractibleWidget.

Added a new teleportation method in 4.21, DeltaTeleportation, it is an attempt to clean up physical grips on simulating bone chains when teleporting.

Like such
[video]https://i.imgur.com/ZxX6qoD.gifv[/video]](Imgur: The magic of the Internet)

It still needs some debugging work, but its already showing better results.

Would it be better to do that in c++ or possible in a child BP class of the GS. i had a glance through the interactiblesSettings.h and cpp, im no master coder though.
Confused as how best to tick or execute the actions within the script in blueprint

You can do it in BP, C++ is only better because it avoids the overhead of the scripting translation.

Just overload the GetWorldTransform function and modify the transform to suite you. A child class of GripScriptBase_BP.

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

If doing the logic is easier for you in the main actor you can do that and just set a clamping variable in the grip script.

ahh i see, thanks.
Sorry for all the questions, but whats the correct method for casting to a grip script from a actor its used on to, ie to set a initial transform to base it off
Tried using the get grip scripts on the actor and getting a copy of the the array but the cast always fails to the custom script.

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

works fine for me, though you would likely want to do it just once (on begin play or something) and keep a reference

yea i tried that but it fails every time
Edit: ok apparently it matters which pin you drag the cast to off, if you just type cast to the script in the menu and create the node it wont work, but if you drag it off of the GET it wil work, strange.

Hi ,

How did you achieve the body not being spring-like attached to the HMD like in the below video?

Is achieved completely by your changes to the camera and the bOffsetByHMD bool or is there more to it?

That looks like a tick order issue.

Do you mean the tick group or something else?
I have tried all the tick group options and the problem persists.

What are you assigning ticking too? The Skeletal mesh?

You may want to just sample the HMD height anyway, it doesn’t update camera position until GetCameraView.

I was assigning to the entire actor and the skeletal mesh on event begin play. I also tried setting it from the blueprint properties.

I was getting my location and rotation from the camera, once I changed it to get “orientation and position” it seemed to track much better and not be so spring-like. It is in local space or something right now but I feel like once I get that sorted out the issue will be fixed. Thanks for the help.

How can I get a component like a static mesh to stay with the hmd in only x-y location and only z rotation in the vrchracter, like the capsule does?