Question: Hey, I'm trying to make a basic hockey style game.
I have the basic physics working with the pitch, a player, an opponent, and a ball.

I'm struggling to figure out how I can allow the ball to travel into the goal 
while keeping the player and opponent from going into the goal.

Basically the opponent follows the ball, and the player is controlled by user input.
so there are two restrictions I need.

I need to create a shape that only the ball can go through... is this even possible?
Maybe I can sleep the opponent if the ball passes the goal line?

Am I going about it the right way?

Player1 can only move around in the red box
Player2 can only move around in the green box
The ball can move around in the outer blue box

![playing field layout](https://i.stack.imgur.com/DMBvb.png)

Answer: 
If you're using Box2D, you probably want to look into **Sensors**.

Taken from the [Box2D Manual](http://www.box2d.org/manual.html):

> 
> Sometimes game logic needs to know when two fixtures overlap yet there should be no collision response. This is done by using sensors. A sensor is a fixture that detects collision but does not produce a response.
> 
> 
> You can flag any fixture as being a sensor. Sensors may be static or dynamic. Remember that you may have multiple fixtures per body and you can have any mix of sensors and solid fixtures.
> 
> 
> Sensors do not generate contact points. There are two ways to get the state of a sensor:
> 
> 
> 1. b2Contact::IsTouching
> 2. b2ContactListener::BeginContact and EndContact
> 
> 
>
why don't you use simple collision detection?

if the object that moves over your hockey field is of type player and his position/hitbox collides with the goal, you change his position back to the line, so he possibly can't intersect with the goal. 

if the type of object is not a player you simple let the object pass