Hello everyone,
I wanted to ask a question in general even though I’m still new to UE4, but coming from Unity with quite a lot of experience.
I’ve read most of the documentation about debugging Blueprints (watch variables, breakpoints, Blueprint Debugger, etc.) but I couldn’t find a technique to deal with Blueprints that compile fine, execute fine, but just do not do what I’ve intended them to do.
As an example I want to show the following blueprint.
“Add Weapon” is called from a pickup when the player character walks into it. As a parameter, the pickup passes itself, because I want to carry it. I added a WeaponHolster socket to the Skeleton of the player.
The expected outcome was that the pickup would snap to the socket and move along with the player’s socket on the hand. The actual outcome is that the pickup snapped to the characters center position and just followed him, as if it was just attached to the rootTransform.
So my question is what a good workflow is to find out how to solve these kinds of problems? And by that I mean not this particular one, but in general. What do you do if all the nodes are set as you think they should be set, no errors, but wrong behaviour?
Obviously “Get Player Character” seems to be a valid input for AttachToActor, but will the socket be found since it’s part of a skeleton? How will I know?
Maybe it’s just ignored if it doesn’t exist, like the docs say about the “Socket Name”: “Socket name to attach to, if any”, but how can I be sure?
EDIT: I managed to attach it by adding a “GetMesh” node after the player character value and replace “AttachToActor” with “AttachToComponent”, viewing this video ([Attaching a weapon to a character][2])
So, ok, I could have guessed that I would the mesh to find a Socket, but why is it even possible to choose a socket name on a AttachToActor Node, when it’s impossible to pass a mesh into it?
This is just one of the questions that come up when you try reasoning something you did logically but for some reason still wrong.