Hi everyone,
I’m working on a VR project in Unreal Engine 5 using the VR Template and MetaXR plugin. I’ve created a custom Blueprint for VR tweezers to extend grab range, which uses a gravity-gun style mechanic (Grab Component at Location with Rotation). The tweezers use Enhanced Input Actions.
Now, I want to create a mechanic where the player grabs an object (in my case a sphere) and slides it along the path of a tube, like threading a bead. The ball moves outside the tube, not inside, so using a physical tube as a collider doesn’t help — the ball needs to stay visually outside but follow a precise path.
I was trying to constrain the movement of the ball with a spline that follows the tube’s path, but I can’t overcome the grab action, so the spline constrain is over the grab action.
Here’s my setup:
- The Object Blueprint has:
- A root SceneComponent.
- A StaticMesh for the tube.
- A SplineComponent attached to the tube, to define the path.
- A StaticMesh for the ball itself.
- A Grab Component attached to the ball.
- The ball uses Simulate Physics, collision, and gravity, but these are disabled on Grabbed. However, that On Grabbed event never fires.
- I’ve tried constraining the ball to the spline using Set Relative Transform and Set Actor Location, but it doesn’t work once the player grabs it.
- I suspect the On Grabbed event doesn’t trigger because the tweezers’ Grab Component is the one handling the grab.
- I also tried calling Try Grab on the ball’s Grab Component from the tweezers, but it didn’t work.
My goals:
- Constrain the grabbed ball along a fixed path , ideally using the Spline, but I’m open to other solutions (e.g., physics workaround, custom logic, etc.).
- Ensure the ball moves only along the spline or predefined axis, even while being held.
Any advice or ideas? I’ve hit a wall trying to make the grab constraint coexist with a path-following system.
Thanks in advance for your help!