Currently I am trying to find out how to stretch a mesh between 2 points in real time.
I have a old style phone in my game. All the parts of the phone are separate static meshes (I have them all together in a blueprint). What I want to do is have the phone cable mesh stretch between the handset and base of the phone. This will have to work in real time for the game. So when the player interacts with the phone, the cord mesh will stretch between the base socket and the handset socket.
I have tried attaching component to component, but it only works on one of them. The cable stays very much static. No matter which way round I attach the components or what component is attached to what, its the same result. I have 2 sockets on the phone cable, 1 socket on the phone base and 1 socket on the phone handset. The base and handset have sockets of the same name.
I can’t use a spline because that would make too much cord. Could this be done with a skeletal mesh maybe?
Thank you for any help. Even if its just a link to a video that explains what is needed, I appreciate it.
I suppose yes. There could be a plugin around somewhere for cables or rope. If you don’t need anything complex, no physics, no collision etc, I would just go make that phone a skeletal mesh. You could weight paint the cable to two vertex groups (bones). One group on the base phone, one group on the phone handle. The cable is weight painted softly to allow stretch between points. If you then move that bone on the phone handle you should see the cable stretch out in a straight line.
You could use the built in cable component feature, but you’re only going to be able to have a texture around a cylinder with it, and not an actual 3d model.
A Spline Mesh Component would be the easiest way to get something functional imho. It will handle the deformation and get you something that can look ok.
That said you won’t have any kind of dynamic (physics). If that’s what you want then Skeletal Mesh seems more appropriate.
Thanks for the replies everyone, I will look into using a skeletal mesh. I not going to worry about physics as its just going to stretch from position A to B and back again. Could probably make a control rig for the skeletal mesh and give it animations.
I don’t consider Unreal fit for making source files (textures, meshes, animations, audio) and so on. You’ll be depending on its limited functionality and tied to UAssets while you could pick any external tool specialized to do the job correctly. Go with blender. It will suck in the first days or weeks so instead of smashing keyboards you learn the basic controls, layout, then follow the 4 part tutorial. Export mesh + skeleton to FBX and drag the FBX into the editor where it will turn into the assets you are used to. There are tutorials on all those steps on youtube.
If you were to modify assets inside the engine you would very quickly run into annoyances like I discussed here: