I’ve seen lot of tutorials about attaching a gun to the socket of the hand of a character, but i don’t succeed in adapting the tuto.
I’ve a vehicule with a component clamp. This clamp have a socket called “clamped”.
I want to attach a mesh near the clamp to the socket, but i don’t know how… attach actor to actor ??? I’m a newbie, please help.
There are a couple of ways to do it and they all are fine but leaves you with situations where you maybe can’t get forward with. Most tutorials place the mesh to attach inside the level and use the level blueprint to attach it.
So I can describe one way to do it, but it may lead you into the wrong direction, it depends what you want to do with it next:
- create an Actor Blueprint out of your mesh
- Go into your vehicle Blueprint and add a event begin play (can also be a function and call it elsewhere)
- Create a “Spawn Actor from class” and choose the blueprint class of your mesh you want to attach and that you created in step 1
- Create an “Attach Actor to component” node and select the socket you want the mesh attached to (also get a component reference and attach it to the parent input)
For testing the scaling and positioning can be done inside the skeletal editor by scaling the socket and positioninig it.
A great thanks, that was that !