This is a case of it can be implemented simple, or ultra complex, but mostly your choice.
Sensible soccer is a realistic type? I mean compared to a Bomberman 3D where physics and graphics are basically non existent but just enough to make the gameplay work. From your description, I sense your project inspired by sensi socker is on the realistic side.
realism == complexity. You say you don’t understand the third point of the advice given (the rest is no problem). However, I want to go over the points for a bit so we can build an image together of the final product.
3.:
There are two ways to handling dribbling, a character with a ball.
- accurate physics (trust me, this is not going to be possible to implement)
- “attaching” the ball to the character, so that if the character moves, the ball moves 1:1 relative to the character.
The latter is the way to go. Accurate physics would have you match ball movement to character (animation, turning around etc.), environment physics (grass, obstacles) and such which are both complex to developer and impossible to control with a keyboard or joystick by player.
Here’s 1 of several smarter approaches:
-3. You can create a socket or bone on the skeletal mesh of a character called “ball_position”. This would be a bone attached to the pelvis (root bone). This can be either animated or used as a reference point for IK. A ball (as component, or as actor) can be attached to this socket, to its transform. The idea there is to integrate ball movement with character animation, without the need for any complex (fragile) calculations. For example, if the character turns around 180 degrees, the ball will always follow. Any dynamics in ball behavior while dribbling can now be animated by hand on the character skeleton.
-4 if the player is too far from the ball, or they run too fast, de attach the ball and re enable physics until near enough to a player running below speed X.
-2 no longer required
-1 no longer required.
-5 integrated with 3.
You could even detect the speed or velocity of socket “ball_position” by comparing positions between frames, and say, if the player rotates 180 degrees to fast he loses the ball as well. However you implement such mechanics that in your example were various steps, you can centralize the management of that mostly to the animation system.
Thinking of something event based like:
Character animation blueprint:
- If X happens during animation (state change like the player falls), broadcast “lose ball”.
- If character velocity > X, broadcast “lose ball”
I’d say 99% of the events you take or lose a ball, depend on the state of animation anyhow, and are visual events, so you’d have the animation blueprint manage those events.
Definitions, references:
Sockets are commonly added within UE to add a point to attach stuff to, like a helmet on a head. They are also useful as reference points in IK (Inverse Kinematics). IK is used to automatically alter an animation to match a position, like hands on a rifle or feet on stairs.
Skeletal Mesh Sockets in Unreal Engine | Unreal Engine 5.5 Documentation | Epic Developer Community
The most flexible is adding a bone “ball position” attached to the skeleton root (pelvis) in specialized software like Blender, creating a ball transform animation with it during the skeletons dribble animation, then importing that into unreal.
Once in unreal, you attach the ball to the bone or socket and done. Bonus: you really don’t need to add a second “actor” or component to visualize the ball on the character. Just use the existing one as is.
How do I attach an actor to an actor? - #2 by anonymous_user_923c79df
If you have trouble with walking after attaching the ball actor to the character, note that you might have to play with collision so that the character (and actually, nothing else) is affected by collision of the ball. You can also alter collision of the ball temporarily. I did this a while back in c++, let me know when sh"t hits the fan then I will take a look.