Closed ThijsvanDijk closed 9 months ago
Visitor roams the expected amount of time in the first room. After that, it will 'choose' a new room every 5 seconds, regardless of what it's currently doing. This even leads to them skipping rooms if they have to walk a long distance.
Maybe found the problem? In NPC/States/RoamState.cs
, the Handle()
function calls PeriodicallySwitchRoomCoroutine()
. This function contains asynchronously switches rooms. Could it be that this gets called whenever the visitor changes state, e.g. by looking at a new object?
Dani hit the nail on the head with his theory. A switchroom coroutine was started each time the npc went to roam state, which equals each time they look at an object.
Ask Lucas for more clarification