attaching particle to socket of Skeletal Mesh (runtime via blueprint)
I've seen similar questions but none of them answer my question. Or at least, I'm not experienced enough to interpret them into my project.
Basically I have a Skeletal Mesh object that I have made into a Blueprint, and when the level starts I roll a random chance on it in the construction script (1 or 2). If the result is 1 I will spawn fire on it, and if it's 2 I will spawn Ice on it (I have made two pfx with those attributes). My skeletal mesh has a socket called 'Torch_Socket' and all I want to do is attach either the fire or ice onto the correct socket at runtime. However, what happens is the particle attaches to the root bone of the skeletal mesh, rather than the defined socket. I have tried countless permutations of Attach To, Attach Actor to Actor...etc etc, I've tried making the PFX into Blueprints and on their Event Graphs attaching them to the skeletal mesh socket from there, but I can't get that to work either.
Can anyone give a simple example of what I've described and help me out please?
That's what I have on the Construction Script for the Skeletal mesh. All I want to do is attach a defined PFX to the socket called 'Torch_Socket' on this Skeletal Mesh. Argh!
asked Dec 01 '14 at 01:25 AM in Blueprint Scripting
Hey dazuk1978 -
You will want to add the socket information into your particle system's emitter via a Bone/Socket Location module. In the module, assign your skeletal mesh and in Source Locations add your socket via its name. This module wants an Actor input which would be the blueprint itself and not the component mesh of the blueprint. In order to achieve this, place your emitter in the level (does not matter where). In your level blueprints, call a reference to the emitter and Set Actor Parameter, the Parameter Name is set in the module in Skel Mesh Actor Param Name (by default it is BoneSocketActor). Call a reference to the skeletal Mesh's Blueprint, if it is your player character then Get Player Pawn and assign it to the actor parameter. Play in Editor and you should now have your particles on your socket.
For the check you can always cast that bool variable to your Level Blueprint and set up your branch there and destroy the other emitter (Fire or Ice) if you don't need it.
Also I am referencing the Level Blueprint, but it could do this in another Actor Blueprint, but the Skeletal Mesh cannot be a component of the blueprint which holds the particles.
answered Dec 10 '14 at 09:46 PM
Lovecraft_K ♦♦ STAFF
Follow this question
Once you sign in you will be able to subscribe for any updates here