VR Grab component disables collision detection

Hi,

I know it´s a common question and I might just be missing that´s answered elsewhere already, yet I´ll ask anyway.

Whenever I grab an object in VR, the collision stops to work on the grabbed object, while the collision between grabbable components remains in working order. I thought about making all objects grabbable and then disable movement/ set static (at least that sounds feasible) to get continoous collision detection on grabbed objects too. Sadly I should have started that way before adding blocking volumes to simplify our very complex meshes.

Did you suceed in getting this to work? CCD did sound like the option to go with, but this does not work anymore.

Kind regards

Here are some potential solutions to address the issue of collision detection stopping when an object is grabbed in VR:

1. Improving Collision Detection and Physics Simulation:

  • Use Physics Handle: If you’re using Unreal Engine, the Physics Handle component can help with maintaining collision detection while an object is grabbed. It allows for continued physics simulation on the object, so the collision detection remains functional.
  • Custom Physics System: You could make the grabbed objects kinetic and ensure their collisions continue to be tracked as they move. This way, the objects will stay in the physics simulation even when held.

2. Collision Settings for Grabbable Objects:

  • Keep Active Collision Volumes: Instead of making the object static when grabbed, consider keeping active collision volumes around the object. This ensures that collisions can continue between the object and other elements in the environment, even while being grabbed.
  • Update Collision Profiles: Review the Collision Profiles in Unreal Engine. You may need to modify the collision settings when the object is grabbed to prevent collisions from stopping.

3. Revisit Continuous Collision Detection (CCD):

  • Reconfigure CCD: If CCD is no longer working as expected, tweaking the settings to apply continuous collision detection only on certain objects might help. By using CCD with specific grabbed objects, you can maintain accurate collision detection during movement.

4. Alternative Approaches:

  • Temporarily Make Objects Static: You could make the object static when grabbed, but this will disable its physics interactions. Then, when the object is released, it would return to dynamic mode. However, this could affect the collision behavior, so it needs to be tested carefully.
  • Use VR Frameworks: If you’re working in Unreal Engine, using VR-specific frameworks like the VR Expansion Plugin might help solve this issue, as they provide optimized tools for VR interactions, including continuous collision detection.

5. Event-driven Approach:

  • Consider using an event-driven approach, where the collision profiles are dynamically switched depending on whether the object is being held or not. When the object is grabbed, its collision profile could be adjusted to maintain collision detection, and when it’s released, collision can be re-enabled.

Conclusion:

  • You can try using Physics Handle or adjust Collision Profiles to maintain continuous collision detection on grabbed objects.
  • If CCD isn’t working properly, other physical simulations or an event-driven approach could help to keep collision detection active.
  • Unreal Engine provides many powerful tools to optimize physics interactions and collision detection, so you have several options to troubleshoot and resolve this issue.

Hello,

sadly CCD did not work. Also trying to make even the static objects grabbable to get between mass interaction did not work.

If it´s too much to ask for a detailed approach, mind me.

Is there a more detailed approach?

It seems you’re still facing challenges with continuous collision detection (CCD) and trying to make static objects grabbable. I can provide a more detailed approach to help you solve the issue of collision detection while grabbing objects in VR.

Detailed Approach for Solving Collision Detection on Grabbed Objects in VR:


1. Use a Physics Handle (with Fine-Tuned Settings)

The Physics Handle is the best approach to maintain continuous collision detection for grabbed objects, as it allows you to keep the object in the physics simulation. If CCD isn’t working, using a physics handle can simulate the interaction with collision maintained.

Steps:

  • Attach Physics Handle to the Grabbed Object:
    • First, ensure the object has a Physics Body (e.g., Simulate Physics enabled).
    • When the object is grabbed, attach the Physics Handle to the object. This will allow the object to stay physically simulated while being held.

cpp

Copy code

UPhysicsHandleComponent* PhysicsHandle;
AActor* GrabbedObject;

// Attach to grabbed object
PhysicsHandle->GrabComponentAtLocation(GrabbedObject->GetRootComponent(), NAME_None, GrabLocation);
  • Ensure Grabbing Logic is Correct:
    • When the object is grabbed, it should keep its collision active and allow interaction with other objects while being held.

Debugging Tips:

  • Ensure the grabbed object’s collision type is set to PhysicsActor, and its collision responses are set to block or overlap, depending on your requirements.
  • Make sure that grabbable objects are not set to Static while being held.

2. Use Custom Collision Profiles for Grabbed Objects

If you want more control over how collisions are handled when objects are grabbed, creating custom collision profiles for the grabbed objects might help.

Steps:

  • Create a New Collision Profile for Grabbed Objects:
    • In Unreal Engine, you can create a Custom Collision Profile for objects that are grabbable.
    • When the object is grabbed, switch the collision profile to allow continuous collision interactions.Example of switching collision profile when grabbing:

cpp

Copy code

// Grab the object
UPrimitiveComponent* GrabbedComponent = GrabbedObject->FindComponentByClass<UPrimitiveComponent>();
GrabbedComponent->SetCollisionProfileName("GrabbableObject");
  • Set Overlap Responses:
    • Modify the overlap response to ensure that it reacts to other objects while being held, preventing collision detection from being disabled.

3. Enable Continuous Collision Detection for Specific Objects

If you can’t use CCD globally for all objects, consider manually enabling it for the grabbed object.

Steps:

  • Enable CCD for the Grabbed Object:
    • Set bUseContinuousCollisionDetection to true for the grabbed object to ensure continuous collision detection is enabled while the object is being held.

cpp

Copy code

UPrimitiveComponent* GrabbedComponent = GrabbedObject->FindComponentByClass<UPrimitiveComponent>();
GrabbedComponent->SetUseContinuousCollisionDetection(true);
  • Reset CCD when Released:
    • Once the object is released, you can reset the CCD setting to its original state.

4. Adjusting Object Physics When Grabbed

You can experiment with temporarily adjusting the physics behavior of the grabbed object to keep it in a dynamic state, allowing continuous collision interactions.

Steps:

  • Enable and Disable Physics While Grabbing:
    • Enable physics when grabbing an object and disable physics while holding it, but still keep the collision responses active.Example:

cpp

Copy code

UPrimitiveComponent* GrabbedComponent = GrabbedObject->FindComponentByClass<UPrimitiveComponent>();

// Enable physics when grabbing
GrabbedComponent->SetSimulatePhysics(true);

// Disable physics while holding
GrabbedComponent->SetSimulatePhysics(false);
  • However, make sure the collision response is still set to overlap or block during the holding phase.

5. Event-Driven Collision Switching

You can switch the collision detection dynamically based on the object’s state (held or not). Using event-driven logic for switching collision profiles when grabbing or releasing an object can offer a more tailored approach.

Steps:

  • Switch Collision Profiles on Grab/Release:
    • When grabbed, set the object’s collision profile to something like GrabbableCollision, which is more suitable for the interaction.
    • When released, revert it to the normal profile.Example:

cpp

Copy code

if (bIsGrabbed)
{
    GrabbedComponent->SetCollisionProfileName("GrabbableObject");
}
else
{
    GrabbedComponent->SetCollisionProfileName("Default");
}

6. Testing and Debugging

Test different settings with collision logs and debug drawing to ensure that the collision is happening as expected. Use Unreal Engine’s built-in debugging tools to log collision events when objects are grabbed and released.

Conclusion:

  • Physics Handle is the most reliable method for maintaining collision while grabbing objects in VR.
  • Adjusting collision profiles and CCD settings for specific objects can improve the interaction.
  • Consider an event-driven approach to dynamically switch between collision profiles based on whether an object is being grabbed.

Chat GPT answers aren´t really helpful.

I already added an “enable collision” node for any grabbed object in the Blueprint for VRpawn. Compiles as it ought to, does nothing.

Eversince this is an apprenticeship, what you can think of stopped to work. Filth they beat nonsense into all that follows. Quite a German thing. Scheißland.

Screw that whole Unreal thing. I should have stayed with Unity.

1 Like

Actually i prefer unreal engine for cpp because of cpp strong more than c# , stay on UNREAL ENGINE i belive future is UNREAL ENGINE

I have no choice due to working in the industry.

Spare me you ideological crap. I am old and I know how often you and other tech companies used money to flush down what´s better at everything.

I won´t recommend you to anyone that has a choice and especially not to people that have brains of their own.

Now do your job and make it work as advertised or quit your job.

Also I reported you, you ■■■■■■■ troll.