No announcement yet.

Mesh attached to socket displaces during runtime

  • Filter
  • Time
  • Show
Clear All
new posts

    Mesh attached to socket displaces during runtime


    I have a C++ Character that I have turned into a BP class. The character is the FPS template character with some modifications. I have some issues with attaching weapons to the sockets of my skeletal mesh and hope someone might have an idea what could be wrong.

    In the constructur of th character class I setup the components like this:


    When I open my derived BP in the editorthings look fine (well at least the weapons are attached where i expect them to)
    Click image for larger version

Name:	Preview.png
Views:	123
Size:	336.5 KB
ID:	1773440

    But when i hit the play/simulate button the items pops out of the sockets and end up at the characters feet. They are also pretty static and not moving according to the animation.

    Click image for larger version

Name:	Runtime.png
Views:	32
Size:	334.7 KB
ID:	1773442

    If anyone have any ideas why this happens I would appreciat it

    Few things I have checked:
    1) Socket names are correct. Else they would not place the weapons in the preview.
    2) Meshes are set to movable.
    3) I have tried to disable gravity for the meshes
    4) I have tried to swap the meshes with the template FP_Gun mesh, this renders same result (however this mesh gets animated)

    Thanks in advance
    Attached Files

    Greetings again everyone.

    A bit embarassing but I have already found the solution. Reading a comment in the "BeginPlay" function made me realize that the skeletal mesh is not yet created in the constructor. Thus the meshes cannot be attached to it ...

    I added this code to the BeginPlay(); function:

    Things now work as expected