5 minutes
Score in the Net
Right now, you can dribble the ball into the net and nothing happens: no point, no reset, no score. The goal line is only paint on the grass.
Four components fix that: Goal, Score, BallReset, and Scoreboard. They all listen for one event and none of them ever calls another. When the ball crosses the line a goal fires, the score goes up, the ball moves back to centre, and the HUD updates.
Add the goals, the score, and the HUD
Each net gets a Goal: an invisible trigger box whose ownerEntity is the team that scores into it. Then add a Score entity to hold the tally, a Board for the scoreboard, and a BallReset on the ball:
The ownerEntity swap is on purpose. A ball in the red net scores for Blue. So RedNet's owner is Blue. That one string sends the point to the right team.
Continue reading
Unlock the Full Course
Every lesson, the runnable examples, and the finished build — yours to keep.