A* Pathfinding Project

RVOController doesn't work until properties edited through inspector


#1

I add RVOController at runtime.

if (RVOSimulator.active != null)
	{
			rvoController = Utility_Common.CreateOrGetComponent<Pathfinding.RVO.RVOController>(gameObject, out isNew);
			UpdateRVOController();
	}

void UpdateRVOController()
	{
		if (rvoController != null)
		{
			int myTeam = Team;
			// 2 is to skip DefaultAgent = 1 << 0, DefaultObstacle = 1 << 1,
			if (myTeam < 0)
			{
				rvoController.layer = Pathfinding.RVO.RVOLayer.DefaultAgent;
				rvoController.collidesWith = (Pathfinding.RVO.RVOLayer)(-1);
			}
			else
			{
				rvoController.layer = (Pathfinding.RVO.RVOLayer)(1 << (myTeam + 2));
				//rvoController.collidesWith = (Pathfinding.RVO.RVOLayer)(IGameSystem.Instance.GetTeamManager().GetFriendlyMask(myTeam) << (2));
				rvoController.collidesWith = (Pathfinding.RVO.RVOLayer)(-1);
			}
		}
	}

For testing, I set collides with to Everything and the radius to a large value in order to force the units to spread apart. You can see from this screenshot it doesn’t work

Run again, in the inspector set radius to 2.401 instead of 2.4.

As soon as I do that the bunched up units spread out


#2

A* Pathfinding Project Version: PathfindingProject_Pro_WebsiteDownload_4_2_8_4262b723
Unity Version: 2019.1.8f1


#3

Bump. Any idea on this?


#4

Hi

I have not been able to replicate this. Furthermore I have checked the editor scripts and I cannot see any updates that are triggered by the inspector being edited. Do you think you could post a video of this happening and/or a test project in which I could replicate the bug?