Cable AttachEndTo not working?

I’m trying to spawn a Cable Actor into the level during gameplay and while the AttachStart of the cable attaches properly to the spawning actor, I’m having issues attaching the AttachEnd of the cable to another actor. I do have a socket in the static mesh of the end actor and using it to no effect.

If I define the cable’s SetEndLocation to 0,0,0, then the cable will spawn with its end fixed to it’s spawn location. If i use AttachToComponent to the end actor, then the end of the cable seems to attach to the actor but it’s attachment point is somewhere randomly in space (but the end of the cable does move when the end actor moves).

Are there any other methods to attach the end of the cable to a target actor? Has anyone been able to resolve this issue in the past?

Thanks!

There’s the end offset option that’s set to X=100 by default. Did you change it to 0?

Yes, i set this in the Details Panel all to 0’s and it’s still not working. The end point of the cable still attaches to the intended target at an offset distance.

Set the attach to actor and then afterwards set the offset. The offset resets to 100,0,0 whenever a new end actor is set, in my experience. The oddball position is 100 units to the right in actor space.

Something like this works:

FComponentReference ref;
ref.OtherActor = Next;
Cable->CableComponent->AttachEndTo = ref;
Cable->CableComponent->EndLocation = Mesh->GetSocketTransform(FName("Plug"), RTS_Actor).GetLocation(); 

Where “plug” is a socket or bone in the target mesh where you want to place the cable. If you don’t have such a bone in a mesh simply use FVector(0,0,0) instead.

Set the attach to actor and then afterwards set the offset. The offset resets to 100,0,0 whenever a new end actor is set, in my experience. The oddball position is 100 units to the right in actor space.

Something like this works:

FComponentReference ref;
ref.OtherActor = Next;
Cable->CableComponent->AttachEndTo = ref;
Cable->CableComponent->EndLocation = Mesh->GetSocketTransform(FName("Plug"), RTS_Actor).GetLocation(); 

Where “plug” is a socket or bone in the target mesh where you want to place the cable. If you don’t have such a bone in a mesh simply use FVector(0,0,0) instead.