All works fine, but I want to attach the start and end point of the spline to dynamic meshes so that the cable stretches between them.
I looked at a lot of tutorials and spent hours of googling but somehow and can’t figure it out.
If someone could point me in the right direction I would really appreciate it.
Thank you in advance.
You need to update the spline mesh components as you update the spline points, too. Essentially what you’re doing up there but without adding the components.
It took me quite a while to figuer out how to reference my target objects. I think i am on the right track, but somehow I can’t get it to work.
Here is what I did so far:
Just guessing that world position is the right way to go. But no matter what coordination-space I use I can’t get it to work properly.
Here is the Result:
Well… that’s kind of embarrassing.
I literally spent over 5 hours today, trying to figure this out, and started over a couple of times. So yes… that’s exactly what I forgot.
I had to change the GetWorldLocation to GetActorLocation. After that it worked like a breeze.
Anyway, thank you for pointing this stupid mistake. I keep you updated…
Not sure what you’re trying to achieve but there is a cable component in the engine already (a plugin that’s enabled by default). It simulates physics and its ends can be attached.
It’s somewhat simple and looks like this:
Didn’t know about the cable component. I just wan’t a calbe with connectors on each end. So it is very close. But I probably need more controll at the beginning and end of the cable.
I will experiment with this component some more and post the result…
Hi,
it is as I thought. The Start and Endpoint just ignor the rotation of the start and end connector.
I need it to interpolate at the ends so that it curves accordingly. Right now it looks like it is not really
connected:
If you need a wire that will coil realistically and support custom tangents at specific points, the cable component will not cut it. I believe it was designed as a cheap, real-time physics based, free-hanging rope/chain.
However, you should be able to achieve an interesting (but simplified) effect by dynamically adjusting the length of the cable based on the distance between the attachment points and (optionally) enabling stiffness. This should take care of
Trial and error might be required to get the look you’re after:
you can disable Gravity, this will keep the cable straight
or lower the gravity and increase the Cable Force (Z)
make the length a bit shorter/longer than the distance between the attachment points
Here’s one with inverted force, low gravity scale and length set to 120% of the distance between attachment points:
https://i.gyazo.com/6c3998c5ae78c1f0…1b20800876.mp4 [HR][/HR]
Using splines for this will give you access to each point’s arrive and leave tangents, enabling greater control over the *stiffness *of the whole thing. But you will need to write the algorithm yourself.
[edit]: you might be able to use a curve editor to *paint *the curve and then apply it to the length of a spline and calculate positions of the spline mesh component. Untested but could work.
A common sight that’s rather difficult to simulate:
Is it possible to import animated Splines, and just use UE to put the Splinemesh on?.
I don’t need Realtime simulation just a fixed keyframed animation.
Maybe I could use a long bone-chain as an alternative and import it as skeletal-mesh. Might be a lot of work to animate thou.
It is using only 2 Spline Mesh Components and a *Spline *with 3 points; it can be extended/made more dynamic should you desire more fidelity, of course. The anchors dictate start/end positions of the spline points 0 and 2, and their *rotation. *(anchors’ forward vectors are used and tangents)
You will need to call the above functions whenever the spline needs an update. The animation I attached was using a timeline and called them every frame.
The above places spline points 0 & 2 at the anchors and the midpoint between them with some fake *gravity - *the more further apart 0 & 2 are, the lower the midpoint goes. You could clamp this value by linetracing towards the floor (and dynamically adjusting midpoint tension) so the mesh never clips it and sits pretty on top. It will never resemble actual simulation, though.
We have 3 points but only 2 SMCs hence the Branch.