Is it possible to make RDR2/Poppy Playtime style rope?

I don’t even care it’s physics based (I would prefer if it wasn’t).
Exactly like the rope physics from poppy playtime. Notice how the rope wraps around (and even collides with) the poles.

RDR2: (can somebody PLEASE tell me what I did to obs to hurt its feelings? I have the crappiest and most abysmal video quality ever comprehensible and its still 20 FRICKING MEGA BYTES)

2 Likes

yes it is definitely possible to create such ropes but only with cubes, spheres etc because you won’t be able to get the vertices of mesh parts (except for editable mesh which is currently in beta).

How would you achive it? You have to find rope intersections to your obstacle (using raycast), then you have to find vertices which will be the nearest one to start and end point, after that raycast to your points while the length is giving opportunity.

(it is hard to just explain it without code and in just 1 message, so you have to create it yourself)

2 Likes

A fast and dirty way to do this would be to cast a ray between your hand and the grabbed object each frame and when the raycast hits something, fire a bunch of raycasts using a :Lerp() between the current hand position, and the previous frames position. For example: local cornerPosition = grabbingHandPosition:Lerp(rightHand.Position,math.clamp((amountToCheckBetweenPositions)/(rightHand.Position-previousHandPosition).Magnitude,0,1)
Then you would take the raycast closest to the edge (while still intersecting it) and visualize that raycast and moving it out slightly.

local linesMagnitude = (grabbingHandPosition-cornerPosition).Magnitude
local visualizationPart = Instance.new("Part")
visualizationPart.Anchored = true
visualizationPart.Size = Vector3.new(.1,.1,linesMagnitude)
visualizationPart.CFrame = CFrame.new(grabbingHandPosition,cornerPosition) * CFrame.new(0,0,-linesMagnitude/2)
visualizationPart.Parent = workspace

Your obs issue may be related to your bit-rate which you can change in your settings.

Thank you so much @change_mom for your response! I had no idea editable mesh existed, and have been looking for something like this for a few days now before stumbling upon this thread by accident.

2 Likes