Hi, something very weird is happening with my blueprints. I wanted to make a weapon and attach it to the character in the third person template project. I created a custom component called RightHand which has its parent socket set to hand_r bone on the skeleton.
I then have a BaseGun blueprint which is supposed to be abstract and has placeholder variables for things like velocity and an abstract bullet object reference (which doesn’t get filled yet).
When I press a button (num pad 1 for now) I spawn in a Musket which inherits BaseGun and sets some of the default values and has its own gun mesh. I then attach this to the RightHand component and set the location type to Snap to Target so that it will stay in the hand. Here is the blueprint:
(Adding/removing the socket name doesn’t affect anything)
The problem is that when I do this the gun goes where I want but the movement of my character is from then on completely messed up. It’s hard to explain but when I press any direction of movement my character moves to the left at a much faster speed than normal. It doesn’t work at all… It seems like this should just work. ,
Well I’ve solved that problem. It turns out that because my gun mesh had collision set to BlockAll by default it was colliding with the character and pushing him out in a line normal to the collision which is why he always moved left and no other direction. This would explain why it still worked when I set the location setting in the Attach to Component block to “Keep world location” instead of Snap to Target… It was never colliding then.