So i have a pickup system that plays this code HoldingComponent->AttachToComponent(GetMesh(), FAttachmentTransformRules(EAttachmentRule::SnapToTarget, true), TEXT("Hand"));
It works fine but the meshes are going to the wrong position in the socket, i could fix it by moving the socket but i am using multiple meshes in my game so it would be great if somebody could tell me how could i make meshes go in the correct rotation axis with multiple meshes with different rotations in need.
The meshes attach to the socket but the meshes are rotates the wrong way!
Oh i think you misunderstood my problem, the pickup system is working fine but when i take the mesh to the hand i would like to change the meshes rotation but every mesh i would want a different rotation cause in my example pictures above the knife is backwards and the axe is sideways. I would want to find a way to rotate meshes so they would not look weird in the sockets
Yes, I understand, my English is very bad. Create several socalos, one for the knife, and one for the axe. That way you can correctly square the rotation and position. Another question is that I don’t know at what point the axe and the knife have the same rotation in the modeling program.
how would i do that in code?
and i have the whole pickupsystem in code so i cannot do it in blueprint (some things i can do)
how would that work cause you would have to seperate the mesh and use a if statement maybe?
What I think, is that you can execute two sockets visually having as parent the same bone.
In my case, my character can Helmet a case, but if it is without a case, it can have glasses or not. In such a case I create two sockets in the desired position and rotation for each element that will be on the head.
I also think that by programming you can access that particular socket and change its rotation, position and scale.
But I don’t know how to do it, but I’m sure you can, but the easiest way is to create those two sockets, one called in your case axe, and another called knife.