In my game, players are teleported to a 1v1 match, were the aim is to score more goals then the opponent. For this to work, I would need to be able to detect which player has scored a goal, and keep track of that.
What I’ve tried is creating transparent parts within the goals, to detect whenever the balls rolls in. I then raycast 1 stud behind the ball to detect if their is a player controlling/ moving the ball. The issue here is that you don’t need to be directly behind the ball to move it, for example on an angle, or if your torso clips the side of the ball, where the raycasting wouldn’t be able to detect this. Alternatively, I tried working with touched events, though it was inaccurate. What I’m wondering is how you would actually detect who kicked/moved the ball into the goal/s. I could try using tick, to possibly detect who touched the ball last, before it rolled into the goal, but this would probably require using touched events, which would become quite messy when there are many players who are touching the ball. I also don’t think this would make any sense, because how you differentiate who is touching the ball last from the other consistent touches?