Pinning a photo mesh to a clothesline

I was really hoping to figure this out myself, but after days of AI leading me in circles I’ve resorted to the forums again… This time I’m trying to create a system that allows the player to “pin” a paper PhysicsObject to a line.

I initially tried using sockets but as a beginner I didn’t get far. I figured if I gave the edges of the paper collision spheres and the wire spheres as well, I could detect when they overlap and attach the component, but the system was overcomplicated and didn’t work.

What I’m trying to achieve is allowing the player to pin the photo on the wire at any location, and at any rotation as long as two edges are touching the wire (and another photo isn’t there). If they want to move it, they just need to pull downwards and it should snap off.

Is there any way I could get the edges to attach to whatever part of the wire it hits? I considered a long collision cylinder but no clue how I’d get the location it’s touching to attach it to. Thank you in advance!

Does this have to be a collision detection based method, or can it works similarly to this?

This will also work with the line at odd angles if that’s a concern

Wow that’s really well made! I was able to get somewhat of a system working but it doesn’t allow for moving it like that since it’s based on set points.

Your system seems really impressive, and as long as you can add/remove photos from the line it would work amazingly! Do you think you could share your method for what you made? I’d love to see how you make it snap and move along the axis like that. Thank you by the way!

I didn’t add a way for it to snap on and off or anything, I just quickly threw together a way for it to snap to a line. But you absolutely could make it be able to yank off, without requiring any sort of physics or anything.

Basically the way it works is we do some math to tell where on this imaginary plane our camera’s forward vector is pointing.


I just placed this arrow component at the center of the rope for visuals, but it can really be any scene component, even the spline component which I’m about to discuss in a moment.

I calculated the intersection point with this code

That spline I was talking about has two end points set to each side of the “rope”

then I just plug the output of the previous node setup into this function for the spline and the main part is done

from there you just have to play around with some offsets. I didn’t really have time to mess with that stuff too much, but I did make the axes of the paper align to the arrow, which allows it to align itself with any orientation of the bar.

You probably won’t want to copy this exactly, since its going to depend on which direction your paper’s normals are facing. But since I was just using a default plane, the face normal was facing to the z axis, so I had to do this to flip it the right way.

Now if you still wanted to use physics constraints, you could still do that and use this method to place the physics constraints along the rope with some offsets and stuff

1 Like