Hi,so the problem is :I’ve created blueprint character but can’t attach anithing to his socket ,everytime it attaches to the center point of pawn. But to the same character model(skeletal mesh) it attaches perfectly , so I guess my problem is that Blueprint character hasn’t got reference to mesh so it always attaches to center of player( in my case to the center of blueprint character) .Can anyone help me to solve this issue.Thanks.
Well, you already wrote it. You need to attach it to SkeletalMeshComponent rather than the actor.
So in the Blueprint just take the node AttachToComponent(or anything along those lines) instead of AttachToActor and it should work.
Yes, I tried it millions of times , the problem is that AttachToComponent doesn’t have the input for character ,it has “In parent” input where I can connect only SceneComponent but I can’t convert pawn reference to this…I can connect anything to enywhere=) , but nothing to my bot!(blueprint character) I can connect to myself easily by using node “get player character” but it attaches to my character only! So ,again guys , the issue is that I need to somehow connect mesh to another bot that i’ve created.
P.s Mesh always attaches to bot’s capsule (just at the center of pawn)_
You mustn’t put in the Pawn in as parent, but the Pawns SkeletalMesh(that one that has the socket).
So instead of putting in “get player character”, you should put in “get player character” -> “Mesh” to make it work.
I am at work at the moment, so I can’t make any screenshots.
Yes I did it. Get player character -> Mesh . As I said previously it attaches things to my character . I need to attach to bot that i’ve created , another pawn walking with me in my world=)) . Another words the method that you’ve suggested I tried and it works but with my pawn only , I need to do another thing.
oh, now I understand. Well, you just have to get the reference to that bot then and replace “Get player character” -> “Mesh” with “Bot” -> “Mesh”.
There are serveral ways to go on from now on. Either you try to get a reference to that bot in your Blueprint. Or you bring whatever item you want to attach to the bots blueprint.
An easy way to get references of stuff in the world is “GetAllActorsOfClass” So drag this note into your blueprint and pick the bots pawn class in the drop down. Now you can take the references of the bots(you will get every bot in the world) and attach stuff to their meshes.
Obviously that is just one way to get the reference to the bot, you could also trace for them or using overlap events - it depends on your gameplay and what you want to achieve.
Amazing! It works! thank you very much!Problem resolved!