"Attach Actor to Component " doesnt work properly in first person template
Hello . First of all , i'm using the version 4.5 on the engine and here is how to recreate the problem :
I created 2 projects , first one based of "first person blueprint " template and the second one based of "Third person blueprint " template .
Then i created a Socket in the right hand of the default pawns in both projects named "Weapons" , then added a preview mesh to the socket for getting the rotation and transform right .
then in the level blueprint i added the setup shown below , to attach a mesh to the socket when the game runs. i actually tested this with static mesh/skeletal mesh/blueprint in both projects , with both default pawn( blue man and blue hands) and my custom pawn .
Here is the results in first person template :
*Attaching Staticmesh to socket in first person template : it simply doesnt attach , and gives an error when exiting play session .
*Attaching Skeletalmesh to socket in first person template : it attaches to the characters feet (root ?), and not the defined socket and doesnt inherit the rotation and position of the socket.
*Attaching blueprint to socket in first person template : it attaches to the characters feet(root ?), and not the defined socket and doesnt inherit the rotation and position of the socket .
in fact if you dont write anything in the " in socket name" in the "attach actor to component" node , the result are the same , it seems it doesnt recognizes the socket at all .
Here are the results in the 3rd person template :
*Attaching Staticmesh to socket in 3rd person template : it works fine and as expected.
*Attaching Skeletalmesh to socket in 3rd person template : it works fine and as expected
*Attaching blueprint to socket in 3rd person template : it works fine and as expected.
i have tested this with both default pawns and assets and my custom pawns and assets in both projects and the results were the same . So the question is , is it a bug ? since i want to attach my weapon blueprint to my character , and it just doesnt work in first person template .
I figured out why this is happening :
In the third person template , in the character blueprint , skeletal mesh is assigned to "native skeletal mesh component ", which can actually do the attaching events properly .
But in the first person template , " native skeletal mesh component" is empty . there is another "skeletal mesh component" ( not native ) , which is parented to camera , because it needs to inherit rotations of the camera . it is this way because you cant parent "native skeletal mesh component" to anything , nor rename or remove it .
to sum it up : Attach events doesnt work properly with "Skeletal mesh component " but they work fine with " Native skeletal mesh component " . and you cant solve this by parenting the " native skeletal mesh component " to the camera , since it cant be moved , renamed , deleted .well that seems like an issue to me anyway .
How to solve :move your skeletal mesh from "skeletal mesh component" to "native skeletal mesh component " then in graph of the character blueprint , add an "attach to" node and attach " native skeletal mesh" to camera when begin playing .
answered Nov 25 '14 at 08:45 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here