Yellow-Dog-Man / Resonite-Issues

Issue repository for Resonite.
https://resonite.com
120 stars 1 forks source link

Volume-Based Grabbable Recievable Surface #2373

Open AegisTheWolf opened 1 week ago

AegisTheWolf commented 1 week ago

Is your feature request related to a problem? Please describe.

Placing held grabbable objects in a volume that would automatically parent to the object when let go, (This would be useful without the need to use complex protoflux to achieve this)

Describe the solution you'd like

A component created in the similar vein as the grabbable receiver surface that has similar parameters to the other component but with parameters to specify a volume made out of a primitive collider (sphere, cone, box, etc) or a convex hull.

Describe alternatives you've considered

Ive been struggling to find a way to properly do this with protoflux at this time.

Additional Context

The example object/scenario this would apply to would be a "backpack" object that would store grabbable items in a volume that can be worn or placed somewhere where it not is a 2d flat plane the objects snap to.

Requesters

Aegis_Wolf, The Lass 240

ProbablePrime commented 1 week ago

We have GrabbableParenter which sorta does what you're looking for? Give it a try?

shiftyscales commented 1 week ago

Let us know if the GrabbbableParenter fits your needs, @AegisTheWolf - based on your description- it should. You can use any volumetric collider to define the area you want to intercept grabbable objects.

You can also specify the slot they store under- my only recommendation- do not store the grabbable objects under the slot the GrabbableParenter is on- otherwise their colliders add to the effective bounds of the GrabbableParenter making its radius larger and larger sucking up any grabbable objects released around it.

If the component meets your needs- this issue could be closed.

BaxterOttoman commented 6 days ago

The grabbable parenter lacks a lot of the features that grabbable receiver surface has. To really be be a good analogue, it really could use some upgrades to be more in line with the reciever surface component. Even in the case it is suitable for Aegis's current needs, I think it's still worth considering a new component or expanding the existing one.

ProbablePrime commented 6 days ago

If there are missing features you'd like you can open a separate issue to request them. Based on Aegis' description here the component meets the requirements.

AegisTheWolf commented 2 days ago

Let us know if the GrabbbableParenter fits your needs, @AegisTheWolf - based on your description- it should. You can use any volumetric collider to define the area you want to intercept grabbable objects.

You can also specify the slot they store under- my only recommendation- do not store the grabbable objects under the slot the GrabbableParenter is on- otherwise their colliders add to the effective bounds of the GrabbableParenter making its radius larger and larger sucking up any grabbable objects released around it.

If the component meets your needs- this issue could be closed.

I will check this out, and thank you for reminding me about changing the parent its under as i had a different issue with grabbable receiver surface component that was fixed by changing the parent

AegisTheWolf commented 1 day ago

https://github.com/Yellow-Dog-Man/Resonite-Issues/assets/65252793/5fa61a84-fa29-4748-a161-c3a03dce02bb

So I got the components on an example:

A box collider that has a static box collider that has grabbable reparenter and grabbable reparent block on it to test out the components. and a separate object under the example hierarchy that is where the objects get parented to.

I then encountered odd behavior as grabbable objects do parent themselves when released in the volume, but only certain ones can unparent themselves when taken out of that volume (so far I tried this with material orbs tools, and primitives) and only material orbs so far unparent themselves.

The objects sticking to the volume behavior is explained by the Grabbable object not having the "Reparent on release" bool set to true in the component. If I set it to false it no longer reparents it to the grabbable reparenter. This fixes the issue of object being stuck in the reparenter but makes a new problem. any grabbable object that has the "Reparent on release" bool set to false only gets set to Root as a parent and not the local user space slot (where the user is located in the hierarchy).

The expected behavior Id like to see is if the Grabbable Reparenter component unparents grabbable objects to local user space without having to set "Reparent on Release" to false on every grabbable object.

I can get a public folder link here of the example:

resrec:///U-Aegis-Wolf/R-39D3B0B8579857E94F5FBF3631BA16E817DBBDDF6777E9973172EB9F60D918EE

ProbablePrime commented 1 day ago

Place GrabbableReparentBlock on Box(Holder), and it should work well, I am seeing some oddity with the cylinders being closer to the collider but after placing GrabbableReparentBlock and potentially shrinking the collider a bit as shown at th eend of the video should work.

https://github.com/Yellow-Dog-Man/Resonite-Issues/assets/8791132/5d78a1ec-725d-49d1-924e-67115632dbea

AegisTheWolf commented 1 day ago

Place GrabbableReparentBlock on Box(Holder), and it should work well, I am seeing some oddity with the cylinders being closer to the collider but after placing GrabbableReparentBlock and potentially shrinking the collider a bit as shown at th eend of the video should work. 2024-06-27.20-08-44.mp4

Yup came to the same conclusion that i forgot to add the blocker to the object the grabbables are parented under (the blocker component was under the reparenter slot earlier oops),,,,,,,,,,,,,,,

AegisTheWolf commented 1 day ago

Is the range determined via a radius or volume? If it is a radius can it be exposed to be adjusted in the component?

ProbablePrime commented 1 day ago

Its based on settings in the Grabber. It is not something you can change unfortunately.

ProbablePrime commented 1 day ago

Ok so, when you drop a grabbable, we do a physics based collider check that is sphere based.

The sphere's size is based on the Bounding box of everything you're holding(pictured as blue) + a 1.5 additional units. This additional 1.5 units gives the pictured red "sphere" which due to the extra 1.5, triggers the parenter.

image

The additional 1.5, is a field on the Grabber Component, in your hand. You can't currently change it.

Due to this my recommendation would be to shrink the collider on the box by a little bit.

ProbablePrime commented 1 day ago

Oh and for additional information, the GrabbableRecieverSurface also has this 1.5 extra radius. So you should see similar behavior there but that's less apparent due to the surface's direction parameters.

AegisTheWolf commented 1 day ago

After fiddling around with a collider on another object. i have difficulty getting the reparenting distance changed when trying to shrink a collider that the reparenter component is on. As I kept on shrinking it and it doesnt change the distance much, its very strange to me setting it up correctly.