hello im remaking my soccer game from scratch and i was looking for the best way to attach the ball to the player when they gain possession. i previously used motor6ds, welding the ball to the players hrp and parenting it to the character, which allowed for easy animating but im not sure if its the best solution. i was wondering if anyone has a better idea on how i could do this
#soccer system help with ball possession
1 messages · Page 1 of 1 (latest)
In my opinion, what you did previously might be a good idea, but just making sure its handled in a way that makes it easy to disconnect / connect it to one another. I have a question:
Since you did this previously, Was it smooth / reactive or not?
Cause i have never done any soccer games but i do know the gist of how to make one, but not sure aswell about the answers here! I think there might be S2's who have a good grasp at these types of stuff, just sharing my opinion on it
yeah, it was easy to disconnect since all you had to do was check if their was a motor6d in the right place and then destroy it. it was pretty smooth but there was a bit of glitching with the ball clipping into walls or from other collision
Looking at other games like Azure Latch or Blue Lock : Rivals, they do have these problems aswell (If i remember correctly) BUT i think they used raycasting to check if the ball was clipping into a wall then when shot or done an action that gives an impulse / force into the ball it shoots from behind the character preventing softlocking
I don't know i've never done anything that involves gravity or ball physics sadly enough 
** You are now Level 1! **
Np!
if u want smth advance
u do like
so first when a person touches the ball
detect it
i suggest u to use getpartboundinradius for the detection
and then if there's a person touching it
transfer network ownership by doing ball:SetNetworkOwner(player) or something
what this does is that ur trusting the player to do the gravity and physic and stuff, so basically it'll be so smooth for the person who get the ball
and now u can just give small velocity to the ball on where the player rootpart velocity unit is going
u need an anticheat if ur using this tho, it's easy
u just need to check if the ball go too fast by checking the velocity of the magnitude velocity of the ball or it's not touching the ground for a long time
Yeah i previously uses get parts in radius
Used
Btw network ownership is automatically given to the player from using a motor6d or atleast that what happened to.me
no motor6d
just pure velocity like those game if u want manual posession
if no
just keep it or something
even in the walking anim, the ball is kicked and rolls a specific distance
manually making that for all 8 of my directional walk anims
js for it to look worse
what
get the direction of the rootpart velocity
and just give velocity on where the direction is