Grabbable Object Locked to Spline.

Hey!
I’m currently tackling a challenge in my VR project related to interaction.
Specifically, I’ve implemented a Spline-based Slider with a grabbable sphere that slides along the spline, controlling the movement of a button’s mesh. The idea is to maintain simplicity and performance in the blueprint and code.

Here’s a visual representation:

Green - The Grabbbable Sphere/Button
Red - The spline in which the mesh slides back and forth along.

Slider Blueprint Logic:

I’ve reused the logic for other spline-based interactions like drawers and windows, and it works pretty well. The challenge arises when I want to adapt this for doors, requiring an arched movement rather than a straight slide.

The problem lies in the grabbable sphere following the closest point on the segment, resulting in a straight movement from point A to B instead of following the curvature of the spline. This visual example illustrates the issue:

Green - represents the grabbable sphere
Blue - the desired spline curvature
Red - depicts the actual movement

I’m seeking guidance on how to make the sphere follow the spline’s curvature rather than the closest point between the start and end of the spline. Any insights you have on this would be greatly appreciated!

Thanks a bunch for your time!

Well… I found the solution!

Searched for a while and found this node “Find Location Closest to World Location”:

And now the movement does follow the spline’s curvature.

Still, if anyone has any better solution or ideas for these kinds of interactions, feel free to share!

Thanks for your attention!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.