Inu Games - Modular Snap System Runtime

I added another example to the example project. It shows how to make a user-friendly physics handle with MSSR.
Some parts don’t even require the plugin (grab speed ease-in, depenetration, etc.)

You can see a little video preview here:

https://twitter.com/games_inu/status…14829933334529

and download it on itch as usual: MSSR Examples by Inu Games

Features :

  • Setup phys.handle with MSSR.
  • Realistic detach
  • Mix between simulated and static actors.
  • Physics handle Interpolation Speed ease-in. It helps to grab things more “gently”, example video: https://twitter.com/games_inu/status…45301538443264
  • Max depenetration speed on the physics actors. Setting this will limit forces applied to separate overlapping actors.

Hi @ Great plugin. The only issue I am running into is that I am using this for a Ylands type building system. And if I have many building (snapActor) actors near eachother when a Snap Preview actor is near, perf starts really tanking. Is there something I can disable or optimize to help this?

Another big question I had is, can the system be used with instanced static meshes?

Thanks!

Did you try to use the async option? There is an example of that in the example project. It will run the search for snap points on a separate thread, so the fps should not drop much. You can activate it on the preview actor and use SnapActorsAsync method. On your screenshot it’s not used i think.

> Another big question I had is, can the system be used with instanced static meshes?

Good question. You can snap stuff to instanced static meshes if you add them in target actor components array in params struct. But I’m not sure if it’s possible to snap an instance to something. The plugin expects an actor or a component as input of snap method. Do you move instances in your building system? Maybe you can snap a normal actor, like a placeholder, then move the instance accordingly?

That would be an interesting option to add to the plugin i think.

Hi everybody,
I finally got an Oculus Rift, so I started to make a better VR example for the plugin. Check it out: MSSR Examples by Inu Games, it’s the MSSRVRv3.zip

For the moment it’s only the exe, I will put the project files later.

Some changes so far:

  • Fixed a bug in the old example (it was attaching to the wrong component)
  • Control scheme remade, now it’s Grip to grab/release, Grip+Trigger to detach. There is no separate modifier to snap, just move the cube close enough.
    And if you don’t move the hand for a moment the snap preview will go away. This allows to hold the structure with one hand and to add cubes with another, without having 2 previews kicking in.
  • Cube are smaller, their default cubes were too big for VR
  • There was a bug in FindActorsNearHand, it sometimes couldn’t find the cubes overlapping the hand, but only the left one. I don’t know why. I replaced the overlap query method by another one and it works now.
  • Cubes have depenetration speed set to a reasonable value
  • Table was a BSP, which is not good for collision

My VR experience is only 2 days old, so please excuse the lack of dexterity and let me know if something can be improved or added!

New VR example is here, download project and playable demo MSSR Examples by Inu Games, it’s the MSSRVRv3

I fixed some more bugs since previous post and added some stuff too. Let me know how it works for you.

There is also a tutorial:

Hi everybody,

For the Black Friday Sale the MSSR plugin is 30% off.

Check our marketplace page here:
https://www.unrealengine.com/marketplace/en-US/profile/Inu+Games

New tutorial: Preparing your own meshes for use with MSSR plugin.
Explains lots of things about sockets.

Hi. Great plugin.
I have a small problem. The preview works great but when I release the object it falls or snaps random to another object, although I use the same snap setting for the preview actor and for the SnapActor node

.




I have an VR project with simple attaach detach (acually almost as in the vr example) as I said everything works great except that the snap actor snaps to an random actor in the scene and not to the one shown in the preview

It’s difficult to say what’s going on based just on the info you provided. One thing I notice is the “KeepRelative” in the detachFromActor. KeepRelative will move the GrabbedActor, so try to use keepworld maybe

Oh wow, that was really it. Changed to “keep world” and everyting works fine. Thats actually strange that the detach influences tha snap. But int the end untill it works I am happy. Thanks a lot!

I’m glad it works.

Detach with “Keep Relative” will actually move the mesh, then the SnapActors which comes after that will search the snap points for this new position.

Keep Relative keeps the same relative transform of the mesh, it means its relative transform wrt the hand will become its new transform in the world. “Keep World” recalculates the mesh transform so it doesn’t move after detach. I don’t understand why the Keep Relative is a default option, seems pretty useless.

> Cubes have depenetration speed set to a reasonable value

How can I set the depenetration speed manually in the project I derived from your previous project (MSSRVRv2)? I would like to fix that only before the next iteration.

It’s in Static Mesh>Physics>Max Depenetration Speed property of a mesh. I set to something like 100, which is 1m/s

Oh, so it’s the Static Mesh property, not MSSR related. Thank you.

Another quick question: I couldn’t find the material variable in preview actor. How can I override M_PreviewMSSR without changing the plugin source files via variables? Where do I set it?

The variable is called “PreviewMaterial”, and you can see examples in MSSR plugin content, Materials folder (you need to check “Show plugin content” in Content browser properties.
If you need to make your own material you need a parameter called “Visible” which is the opacity of the preview. BP_MSSRPreviewActor will use this to hide/show the preview.

Update v.1.1.1 submitted to the marketplace, should be released soon.

  • UE4.24 compatibility
  • Fixed bug in SnapComponents method
  • SnapComponents treats “SnapAttachedToo” parameter correctly
  • Added SnapComponentsAsync node
  • Added PreviewComponents method to BP_MSSRPreviewActor
  • Fixed a bug in async methods which appeared when both source and target components moved quickly during the search.

Hey, this plugin looks great and has inspired me! I tried the playable demo showcase and it works amazingly! I have a question about the kind of use I have in mind for it:

I’m wondering how it handles two sockets on the same side of an object, for instance if you wanted to connect bricks to make a wall, offseting each layer, or even making a corner with the bricks by rotating 90 degrees. I drew a quick diagram to show the kind of behavior I’d expect to happen, and if it’s not default would it be something I could implement easily? (The red lines are sockets, green is the placement preview)

Thanks! Hope you had a great holidays

Hi Simmmo,

The socket matching and snapping is always one to one. There is no special handling for two sockets on one face, the plugin will just pick the closest matching pair: one on the green brick and one on the black one, then use that pair to make calculations. So all the options on your schema will work. You need to give compatible names to those sockets, like Brick_0, Brick_1, etc. and they will snap together like you expect.

Thank you
Stan

Hi and Happy new year!

We got our hands on Oculus Quest finally, and, with some adjustments, was able to run MSSR VR demo on it.

So, what we did is:

  1. Follow this guide to create and deploy a UE4 project on Oculus Quest:
    https://developer.oculus.com/documen…t-guide-quest/ (only tested in 4.24, probably will not work in 4.22 and earlier versions)
  2. Migrate MotionControllerMap2 and it’s dependencies from MSSRVR project to the Quest project (don’t forget to move Config/DefaultInput.ini too)
  3. Go to the UE4.24 Plugins folder (C:\Program Files\Epic Games\UE_4.24\Engine\Plugins\Marketplace) and copy paste the MSSR plugin into your project’s Plugins folder.
  4. In your folder edit MSSR.uplugin and add “Android” to the “WhitelistPlatforms” section.
  5. Open the project and in BP_MotionControllerDetach modifiy the preview actor init like the screenshot bellow. This is because the async (multithread) preview is not working well on Quest. Probably there is not enough cores on this thing. Switching to sync preview with a delay of 0.4s seems to run at max fps. To investigate…

That’s it. If everything works alright I will add Android as supported platform to the plugin later.

1 Like

Check it out: somebody used MSSR plugin in an AR app on iPad: https://twitter.com/LideTark/status/1217993491701088262

Steps to build MSSR for IOS, Android or other unsupported platform:

  1. Copy the plugin to your project: from UE_4.24/Engine/Plugins/Marketplace/MSSR to your project/Plugins/MSSR
  2. Edit MSSR.uproject file in your project and add the platform in WhitelistPlatform list. “IOS” or “Android”, etc. depending on your target.
  3. To avoid conflicts uninstall the engine’s MSSR plugin
  4. Rebuild your project