Hello folks
I ran into an issue while building a cable system using CableComponent in Unreal Engine 5. In the end I want to be able to drag out cables and have them transfer oxygen, power, water or whatever trough either input or output. The cables are working fine, however when spawning they bounce from world zero and into the screen as you can see in the video below. I went to google and tried to see if others had found a solution for this, but I ended up empty handed.
Now if you look closely in the video below you can see it happen on the first cable, it comes from the left and shoots into the screen. Annoying right?
At first I thought this issue had to do with the particles itself in the cables, so I went digging into the CableComponent cpp files and tried to set the cablestart location for the particles under void UCableComponent::OnRegister(). Turns out the solution is much simpler than that.
You have to set the variable “Endlocation = GetComponentLocation()”, because the end location effects the particles and were they are in the world, I think they are calculated by being between the cable start and the Endlocation. The particles will start between the start of the cable all the way to EndLocation which is not initialized and is starting at 0.0.0 the very first frame before it positions itself to whatever end location you set.
So there you have it, a solution for others to find.
And below you can see the fix in action, the cables doesn’t have the bouncing effect any more.