# Circle colliders dont work

I have a destination and 2 players.

I want the players to reach the destination and not overlap in the process.

I attached to each player a circle 2D collider and a rigidbody 2D. Also this script:

using UnityEngine;
using System.Collections;

public class Agent : MonoBehaviour {

public Transform destination;
private Vector2 destPostion;
private Vector2 playerPosition;

public float rotation = 0;

Vector2 velocity = Vector2.zero;

public int maxForce = 5; //rate of acceleration
public int maxSpeed = 4; //grid squares / second

//private Rigidbody2D rb;

void Start () {
//rb = gameObject.GetComponent<Rigidbody2D>();
destPostion.x = destination.position.x;
destPostion.y = destination.position.y;
}

// Update is called once per frame
void FixedUpdate () {
Vector3 temp = transform.position;
destPostion.x = destination.position.x;
destPostion.y = destination.position.y;

playerPosition.x = transform.position.x;
playerPosition.y = transform.position.y;
//Work out the force for our behaviour
var seek = steeringBehaviourSeek();

//Apply the force
velocity = velocity + (seek * Time.deltaTime);

//Cap speed as required
var speed = velocity.magnitude;
if (speed > maxSpeed) {
velocity = velocity * (4 / speed);
}

//Calculate our new movement angle
rotation = Mathf.Atan2(velocity.x, -velocity.y) * 180 / Mathf.PI;
transform.rotation = Quaternion.Euler(0, 0, rotation);

playerPosition = playerPosition + (velocity * (Time.deltaTime));

temp.x = playerPosition.x;
temp.y = playerPosition.y;
transform.position = temp;
//rb.MovePosition(temp);
}

private Vector2 steeringBehaviourSeek() {

//Desired change of location
Vector2 desired = destPostion - playerPosition;

//Desired velocity (move there at maximum speed)
desired = desired * (maxSpeed / desired.magnitude);

//The velocity change we want
var velocityChange = desired - velocity;

//Convert to a force
return velocityChange * (maxForce / maxSpeed);
}
}


The problem is they start moving for a bit and they stop.

Also in the scene when I move them with the mouse they overlap. Any ideas?

When you position an object with transform.position = ... you're saying "I do not care what the physics engine thinks, put the object EXACTLY HERE" - and the engine listens, and does exactly what you told it to do, even if that breaks the rules of physics collisions, because you told it you wanted to override whatever the result of the last physics step was. A circle collider won't intercept your transform commands and change them into something else.
1. Move your objects with physics, by using the Rigidbody2D's forces, velocity, angular velocity, etc. That puts control back into the physics engine's hands to stop or deflect objects if a particular motion would cause them to penetrate.