void Start() { TeamRed = new SimpleMultiAgentGroup(); TeamBlue = new SimpleMultiAgentGroup(); ballRb = ball.GetComponent <Rigidbody>(); oriPosofBall = new Vector3(ball.transform.position.x, ball.transform.position.y, ball.transform.position.z); foreach (var item in AgentsList) { item.originPos = item.Agent.transform.position; item.originRot = item.Agent.transform.rotation; item.Rb = item.Agent.GetComponent <Rigidbody>(); if (item.Agent.team == Team.Red) { TeamRed.registerAgent(item.Agent); } else { TeamBlue.RegisterAgent(item.Agent); } } ResetScene(); }