I’d like agents to lock when not moving. This used to be an option on the RVO controller, but I’m not seeing it on FollowerEntity. Does this functionality still exist?
What about isStopped
(units still react to gravity and RVO) or canMove
(completely stops all movement)? Are either of those suitable replacements?
Hmm, I don’t think so. Let me explain the situation:
Picture one unit being ordered to follow another unit. It is constantly setting its destination to the target unit’s position. FWIW, also adjust StopDistance and AgentTimeHorizon variables so it stops just in front of the unit and doesn’t bump into it. That said, when it does get sufficinely close to the target unit to stop moving, it isn’t actually “locked” and can still be pushed around. Now, I don’t want to actually tell it that it can never move again (canMove=false), because it should start moving in the case the target unit moves. I just want to essentially say “if you’re not moving currently, plant your feet firmly, so you can’t be pushed around.” If it needs to start moving again due to the destination changing, then it should do so. Let me know if that’s not clear.
To elaborate upon the scenario – let’s say a bunch of units are bunched up in a choke point and stopping the units in the back from moving. I’d like them to “lock” in place until they can move again.
Hi
The lockWhenNotMoving toggle is not present on the FollowerEntity, but it does have a locked property.
So you could do something like:
void Update() {
ai.rvoSettings.locked = ai.desiredVelocityWithoutLocalAvoidance.magnitude < 0.001f;
}
This is actually very similar to what the RVOController does: