#soccer system help with ball possession

1 messages · Page 1 of 1 (latest)

hard orchid
#

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

mossy fulcrum
#

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

hard orchid
#

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

mossy fulcrum
hard orchid
#

alright thank you

#

also would you recommend that i use a vector force

#

for the ball

mossy fulcrum
#

I don't know i've never done anything that involves gravity or ball physics sadly enough sad

hard orchid
#

me neither im not very experienced

#

well ty

#

i appreciate it

north masonBOT
#

studio** You are now Level 1! **studio

mossy fulcrum
#

Np!

tiny crow
#

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

tiny crow
#

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

hard orchid
#

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

tiny crow
#

no motor6d

#

just pure velocity like those game if u want manual posession

#

if no

#

just keep it or something

hard orchid
#

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

tiny crow
#

what

#

get the direction of the rootpart velocity

#

and just give velocity on where the direction is

hard orchid
#

when a player touches the ball, the ball needs to be attached to them

#

issue is that

#

when for example walking

#

theres an anim

#

of them kicking the ball and it rolling

#

if i use velocity i cant make the ball look nearly as good

tiny crow
#

then just use animation

#

or make a fake leg or something

#

OR

#

use IKcontrol in roblox

#

and manually move the leg to touch the ball

#

to know the leg direction or smth u just do easy subtraction at the ball distance to the feet and the ball radius