Hello, I’m currently working on a 1v1 multiplayer game. The game is basically a mix between Baldur’s Gate 3 combat and BloodBowl.
I’m struggling to find a way to attach the ball (an Actor blueprint) to the character’s hand (a Character blueprint).
I thought about creating a socket in the character’s hand. By default, there’s already a ball attached to the hand. I created a Child Actor component in the character’s mesh, with the ball’s blueprint set as the class.
I’ve coded a function to throw it, which detaches the ball from the hand and launches it away.
Right now it’s still in a testing phase, so I haven’t set up collisions yet, which is why it goes through the ground.
But when I try to pick up another ball from the ground, I can’t get a proper result. I’ve tried several methods:
· Set Actor Relative Location
· Attach Actor to Actor
· Attach Actor to Component
I think I’m using the nodes incorrectly even though the solution shouldn’t be that complicated. Does anyone have a fix or advice ?
Attach actor to component is what you want, if you’ve not already, you have to get the mesh component from the character, and reference the bone name Wich can be viewed in the skeletal mesh asset. For attach setting I recommend snap to target, leave rotation relative and keep world scale
Thanks for your reply, but it doesn’t work — I had already tried that.
I’m going to try to describe my game in as much detail as possible to figure out what’s going wrong.
Each player controls 5 characters. When you click on one of your team’s characters, that character is stocked in a variable called ‘Selected Character’ inside my custom PlayerController (BP_PlayerControllerMultiplayer).
When you select a character, a menu appears with different buttons and actions (move, throw, pick up, attack, etc.).
My character has a ChildActor component attached to his mesh. The ChildActor is the ball, and it is placed inside the BallSocket of the skeletal mesh, located in the right hand.
By default, the character starts with a ball equipped. I throw it at the beginning of the game and then try to pick it up again by walking over the collision box I placed on the ball’s mesh. But I just can’t pick up the ball properly.
Just to confirm — the logic for picking up the ball should be coded in the ball’s blueprint, right?