That’s why he put in the template. Download it, put it in your unreal projects folder, either open up the editor and load the project or just double click on the project file. If you don’t have Visual Studio installed, the editor will helpfully prompt you to download it, so that you can compile the plugin.
Everything looks cool, it is instructive to see the desk the way you would handle it. I had gotten the drawers in physically constrained but somehow not as cleanly, whenever I added the drawers as components for some reason the interaction wasn’t clean, very weird and buggy despite the same constraint settings. I must have missed a setting.
Looking forward to the interaction style version of the drawers because you may have noticed that the drawers don’t quite hold up as physics constraints. Or rather, they behave a little too much like the real thing–if you slam them close hard enough, they’ll clip through a little and get stuck in the desk.
They shouldn’t, if the version I made is doing that then I need to tweak it a little. But regardless drawers are one of the few interactive things that I think would be better off NOT using physics with. Its not required for their interaction so is unduly expensive and would be simpler to do with normal movement limitations in the first place.
weekend i’ll be adding the rotationless option to the interactive settings which will pretty much solve that.
Edit Actually if you were talking about your implementation getting stuck I would suggest looking at the construction script of the ones I made last night. I set some variables that aren’t accessible just as fields on the constraint in there so that the physics constraint doesn’t allow for any backwards movement. By default constraints allow the set distance both forward AND backward and that may have been causing your drawer clipping issue.
It happens with both mine and yours. With a drawer at full open, slamming it shut as hard as you can will usually clip the front of the drawer past where it should. Sometimes you can fish it out again, sometimes not. But yes, moot point, we certainly don’t need or want a bunch of physics for a simple drawer. All that aside it does work well. I tried loading the drawer with a bunch of smaller boxes, thrashed it around, everything behaves quite nicely except for the high speed closing glitch as described.
Ah, then its just slightly too far back to begin with, i’ll fix that since I want to provide examples of both methods.
First of all, excellent work . is a huge service you’ve done for the community, and saves me so much time in getting started. I wasn’t looking forward to figuring out how to properly add pawn push back based on camera movement in a multiplayer environment, and to see that you’ve already done it is amazing. I’m now going through your code to understand how you’ve accomplished all of .
Based on your experience with the character movement code, how would you go about having acceleration free movement for the character (basically how I understand Onward works)?
While trying out your touchpad-based movement options, it looks like there is a slight acceleration and deceleration upon touch and release. That’s understandable while going through the Pawn’s AddMovementInput() function. I would like to try out a controlled instantaneous velocity change instead, while still remaining true to UE4’s multiplayer character movement model (saved and replayed moves, etc.). So rather than the touchpad controlling the amount of acceleration to apply up to the maximum, it controls the character’s velocity up to the maximum speed. Perhaps UCharacterMovementComponent::RequestDirectMove() is the place to start?
Edit: Just wanted to note that the reason I was thinking on RequestDirectMove() was that it looks like you’re sending the requested velocity as part of ServerMoveVR(), which seems perfect for . But I haven’t found yet if it is being stomped by something else.
Thanks!
I’ve trying to get the plugin to work for awhile on 4.14, is what I have tried. I downloaded the file from here: –https://bitbucket.org//vrexpansionplugin/downloads-- it seems really small, but that is what is available at the download page, it is only a 123KB file. I went to (…documents/myProject) and made a folder called ‘Plugins’, I made a folder called ‘VRExpansionPlugin’. is where I put the extracted folder I downloaded. Now, when I try to open myProject, UE won’t let me and it says ‘Missing or incompatible modules in VRExtensionPlugin plugin - would you like to disable it? You will no longer be able to open any assets created using it.’ If i click yes, I don’t have the plugin, if I click ‘no’ it gives me a couple more errors and won’t open my project.
It really is a bummer because I already have a project that I created using it in 4.13 and now I am trying to switch over to 4.14 and it isn’t working. If anyone has any ideas of anything I can try it would be greatly appreciated! Thanks!
Character movement components have a “bForceMaxAccel” boolean that does but it isn’t exposed to blueprint by default and would have to be set in code (or exposed). You could also just set braking friction and acceleration to a value high enough to force instantly the/min speed you have set (IE: 2000048.0 just add two zeros to the default). The thumbpad is also using the capacitive location for speed and if you aren’t right at the edge it will start off slower so you need to watch for that, there is a scaler variable I placed on the character that controls how finely grained the control of that speed is that could be increased to make it get to speed closer to the center.
What I am sending through the network over what is normally sent by the way is the request velocity from the Path Finding, not the general movement, enables the client side navigation to work in servers (which I have actually seen a ton of requests for on answerhub for general games). If you wanted to utilize that to directly request velocities with RequestDirectMove you could but it probably wouldn’t play well if you try to run any navigation commands at the same time.
Edit
I did notice that instant accel is easier for a lot of people to handle, I can’t tell the difference myself anymore (sickness wise), if enough people think it should be the default for the template I can just increase braking and accel to get the instant movement effect by default. If its agreed upon that it is less nausea inducing than I would rather have the defaults already represent that.
Don’t copy the first file in the zip over, that is automatically generated by bitbucket, copy over everything inside of that file into the Plugins/VRExpansionPlugin folder. I also recently removed the binaries from the repository, the file history for them was bloating it too much, so now you have to manually build the plugin. is a required step anyway if you were to want to package out your project as I am not providing it as an engine plugin but as a project plugin. If you don’t have any source files for your project currently follow the steps on the wiki to create a dummy/blank one and build the project which will generate the plugin binaries for you.
The plugin is too unstable in its repository form to build binary packages for as I am still updating constantly, I applied to put it up on the marketplace for free which would allow it to be an engine plugin instead and have stable releases pushed instead if it is accepted.
I fixed it, my re-positioning code worked fine but didn’t work after I moved it to the constructor, some of the values must not be ready yet at that point. I moved it back to begin play and the drawers work as expected now. Physics constraints really need some additional exposed variables, there is an open ticket to add them but its about a year old now so not sure what the progress on that one is
I will still be adding in the movement based version weekend anyway.
Thanks for the help! How would I go about building a plugin? I may just be out of my league here, but it wan’t to much trouble getting it set up with 4.13 so I don’t know if I am missing something obvious or if it has just changed a bunch in the last couple weeks. I am also confused because the file that I downloaded and used with 4.13 was around 300 megs and now the download file is only 123KB, so it is quite likely that I am downloading the wrong thing now. Thanks again!
Is how the “Closest Primary Slot In Range” is supposed to be used? Or if left to default, does it automatically check for “P1” and “S1” as socket names to get “P1” as the closest and base the distance on the “PrimarySlotRange” var?
You managed to snag a version of 4.13 with matching binaries for you, I had to remove them because the edit history on them was going to over fill my repository space.
To build your project it needs to have a c++ source file already so that it generates the .SLN file (ADD NEW button in editor, then source file / blank source file). Then you open the SLN, go to the top under build, and select build (or press f7 with visual studio open). will be required for all projects with plugins that aren’t installed in your engine directory or through the marketplace so I suggest you learn how to do it.
I won’t commit to adding direct pre-built downloads like my other plugin yet as it would take too long to re-build all platforms over and over with each patch at the moment.
Closest primary slot in range can either be filled in by you any way that you like, or you can use the helper static function node in VRExpansionFunctionLibrary::GetGripSlotInRangeByTypeName and pass in the prefix for the slots you are looking for.
My Default implementation in the grippable components designates primary slots as “VRGripP” and then a number and secondary slots as “VRGripS” and then a number. The helper function searches through all slots on the mesh and checks ranges for the ones that start with the correct prefix.
There are only default implementations on the grippable objects though, any custom class that doesn’t derive from one of those needs to fill out the function itself. You can also override the default in any of the grippable objects in blueprint by doing what you are doing.
Thanks! If I were to make a suggestion, it would be to have a grippable object class for skeletal meshes as well. I wasn’t planning on using the grip functionality, but you’re two hand grab functionality future proofs my project so I refactored everything I wrote myself. I’ve said it before but your work is great!
Ah, it makes a lot more sense to me now. Thanks so much for the response, You’re awesome!
I’ve tried out both the high forces, as well as directly using RequestDirectMove(), and at slow walking speeds I can’t tell the difference. So I think I’ll go with your suggestion of using the high forces to get the effect I’m after. Thanks!
I’ve also noticed an error in the Vive_PawnCharacter Blueprint’s CheckAndHandleHoveringMovement function. With the current logic you’re checking if either motion controller thumbstick is greater than zero before processing the hover movement. However, I believe what should be there is a check for not equal to zero. Otherwise, it is impossible to move when the thumbstick is in the upper left quadrant (X and Y are both negative in that region).
I also wasn’t sure if was by design, but it appears that the secondary hand can grip the rifle at any location, effectively making the secondary grip anywhere. While holding the rifle in one hand, I can grab the stock of the rifle with the other hand and pivot between my hands, for example. also makes it impossible to use the slider on the top of the rifle with my secondary hand, as I’m always gripping the rifle instead.
Thanks!
Hi mordental,
I think that the “cartridge example” from VRContentExample (video) can be an interesting addition to your template. , combined with the “lever example” from plugin, can create an effect like the intro of job simulator.
Anyway, thanks for your awesome work. I think UE4 really miss something to let beginners deal with roomscale VR basic interactions; the basic template shipped with 4.13 is good, but not enough. Are you planning to create something like vrtk docs? Maybe the community can help you with it?
Yeah that sounds like the wrong behavior with the track pad, i’ll fix it today.
The gun though is intended and the top cube can still be gripped, I wanted to show that you don’t need slots for dual gripping and that initial relative location doesn’t matter. That being said I didn’t tweak the collision sphere that I use to start my gripping trace from and it is rather large, i’ll reduce it a bit so that gripping makes a bit more sense.
I made some onward style movement in c++ just the other day,
Maybe you can translate something similar to blueprint.
Just figured id share here seeing as we were talking about trackpad movement
Thanks again for the awesome plugin
// Move forward/back
void AProtonCharacter_VR::MoveForward(float Val)
{
if (LeftMotionController && Val != 0.f)
{
//note: i tend to actually grab a bunch of info like during tick. put here for convenience of sharing...
if (LeftMotionController && VRReplicatedCamera) {
LeftHandCurrentPosistion = LeftMotionController->RelativeLocation - VRReplicatedCamera->RelativeLocation;
}
//rotation/direction is from rotation of controller
//you still need to deal with actor/control rotation in your project
// is just to generate movment :)
const FRotator Rotation = LeftMotionController->GetComponentRotation();
const FVector Direction = FRotationMatrix(Rotation).GetScaledAxis(EAxis::X);
//FORWARD is scaled by distance of controller from camera
if (LeftHandCurrentPosistion.Size2D() >= 10.f && Val > 0.f) {
const float TrackpadMoveScaled = TrackpadMoveScale * LeftHandCurrentPosistion.Size2D();
float NewVal = Val * TrackpadMoveScaled;
AddMovementInput(Direction, NewVal);
}
//BACKWARD is not scaled from camera
//and is nerfed down to 0.25, walking backward in vr sucks....
if (Val < 0.f) {
float NewVal = Val * 0.25f;
AddMovementInput(Direction, NewVal);
}
}
}
// Move left/right
void AProtonCharacter_VR::MoveRight(float Val)
{
if (Val != 0.f && VRRootReference)
{
const FVector Direction = VRRootReference->GetVRRightVector();
//strafing in vr also sucks, so is nerfed to 0.25...
float NewVal = Val * 0.25f;
AddMovementInput(Direction, NewVal);
}
}
Then you can just assign the axis in your project settings, and pass through to your character from your pc as per usual…
Pushed some changes
Template Change Log
**11/19/2016**- Fixes
Fixed Hover DPad mode using incorrect comparison operators
Changed gun to have a grippable collision box on top instead of mesh.
Changed drawer example to have both physics and interactive examples.
Tightened up trace sphere to make gripping easier
Grip trace now traces against complex collision to further increase grip accuracy.
ConvertToControllerRelativeTransform node in pickup testing now being passed in to be gripped item to check for rotationless interactive settings in order to get a modified transform.
Fixed issue where since the stopper was parented to the flask on initial grip it could turn gravity off on the flask.
All interactive objects with a locked linear path updated to use rotationless grip for more accurate useage and a better feel.
NEW VERSION REQUIRES REBUILD DUE TO PLUGIN CHANGES
Plugin Change Log
**11/19/2016**- Fixes
Added method for rotationless interactive grips, requires use of the ConvertToControllerRelativeTransform node on client side if networked due to not wanting to bloat the gripping struct any more.
Works without the helper node if single player.
Added grippable skeletal mesh actor/component.
Changed server side physics to correct a bug.
Removed all instances of Interactive Component/Actor from grip target and grip target enum / interface, is not actually needed.
Grip Actor/Component/Object now checks if object is interactive and uses rotationless grip, if true and not a socket grip or already relative transform it will adjust the transform to remove
the controllers rotation on grip.
If the transform is being passed in as already relative (client to server for example) it will need to use the ConvertToControllerRelativeTransform node with the object passed in to remove
the controller rotation from the relative transform. Otherwise interactive actors with rotationless grip won't work perfectly.
I’ve been playing with your sample, great work, thank you!
Is it supposed to work in multiplayer as-is? I tried packaging the sample project and running it on 2 different machines with Vives, on the same LAN, but they don’t seem to connect.
Here are my command lines:
(Machine 1, IP: ) VRExpPluginExample.exe ?listen -log -vr
(Machine 2, IP: ) VRExpPluginExample.exe -vr