x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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!

Product Version: UE 4.21
Tags:
more ▼

asked Jan 18 '19 at 09:43 AM in Blueprint Scripting

avatar image

gHorizon
1 1

avatar image Tuerer Jan 18 '19 at 11:44 AM

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

avatar image gHorizon Jan 19 '19 at 10:58 AM

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

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.

more ▼

answered Mar 18 '19 at 10:31 PM

avatar image

braindigitalis
163 7 10 13

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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.

more ▼

answered Mar 18 '19 at 10:31 PM

avatar image

braindigitalis
163 7 10 13

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question