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"

How do I attach an Actor Blueprint to a socket in a Character Blueprint?

Hi guys!

I got a headless player character (blueprint) that I need to attach a head (blueprint) to when it spawns in the level, but I just can`t figure out how to make it work. As far as I know, this should be an easy task to do using the Construction Script of the player character, but at the moment I am not sure how I can fetch the head blueprint in my player construction script and attach it when it spawns.

I tried a couple of solutions that I thought would work, but with no luck.

Could anyone point me in the right direction please? :)

Cheers,

Roald

Product Version: Not Selected
Tags:
more ▼

asked May 21 '14 at 11:42 AM in Blueprint Scripting

brokenpoly gravatar image

brokenpoly
151 16 21 216

(comments are locked)
10|2000 characters needed characters left

3 answers: sort oldest

Hello,

Have you tried the following from the Event Graph:

alt text

Give it a dummy transform and snap to target on the Attach node (this is assuming your character has a socket in the SkeletalMesh that you can assign the BP Actor to).

As an example here's my head:

alt text

Might be another way to do it, but this is what first popped into my head. :)

-W

eventgraph.png (93.2 kB)
examplehead.png (398.8 kB)
more ▼

answered May 21 '14 at 02:37 PM

Wes Bunn gravatar image

Wes Bunn ♦♦ STAFF
4.9k 141 55 191

brokenpoly gravatar image brokenpoly May 22 '14 at 08:30 AM

Awesome man! Thanks for the reply :)

I did something similar, but it didn`t work when I used a blueprint with a skeletal mesh. It just fell through the player and went on living it`s own little "physical" life. I also tried doing it using the constuction script, but that didn`t work at all, which is a little bit weird. Oh well..

It seems to work like a charm when I use a regular static mesh though, so hopefully this gameplay idea will work out in the end.

Thanks again!

Roald

maelgrim gravatar image maelgrim Sep 22 '14 at 07:22 PM

Hi there, I did all of this too and have the same problem still, https://forums.unrealengine.com/showthread.php?43762-Simple-Attach-problem-trying-to-attach-actor-to-my-arms-socket

thanks alot

(comments are locked)
10|2000 characters needed characters left

[Better Solution in the next answer below]

I solved this. In our game we can pick up Actors (e.g. a Katana) that are a static mesh and have physics.

The following blueprints do it as a macro.

Upper level call: alt text

Lower Level Left: alt text

Lower Level Right: alt text

And the result. The swords on the ground are Actors with physics. The one in hand is just a mesh derrived from the picked up Actor. After pickup the Actor is destroyed from the world. Dropping the sword is the reverse. Or mayby I'll keep the sword actor around but turned off. alt text

more ▼

answered Apr 01 '15 at 05:42 AM

SND R Keene gravatar image

SND R Keene
683 17 79 88

(comments are locked)
10|2000 characters needed characters left

Ok, we discovered it is very valualbe to have the actual picked up Actor in hand so its scripts can do things. E.g. track sweep attack points in a sword. So we revisited this code and figured out a better way to do it. This als allows for multiple meshes in the actor, and is simpler.

Here it is.

alt text

more ▼

answered Apr 04 '15 at 09:10 PM

SND R Keene gravatar image

SND R Keene
683 17 79 88

(comments are locked)
10|2000 characters needed characters left
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