dangoyette
New member
I've just gotten started with Behavior Designer, and I'm not yet clear on how to do things the right way. I'm currently switching out my old state-based AI with Behavior Designer. My problem is how to properly design the behavior to switch between what I'd call "states".
The behavior I'm working on seems pretty simple. It's for a gun turret. The basic idea is, if the player is directly in front of the turret, I shoot the player. If the player is roughly in front, but not exactly lined up, I rotate to aim at the player. Otherwise, I go idle. Here's the behavior as I set it up:
The problem is, what happens is that the behavior gets stuck in the "Gun Turret Aim At Player" action. Here's the action:
My understanding is that the "Can See Target (Narrow)" condition (which is what checks if the player is straight ahead) should be interrupting the
Gun Turret Aim At Player" action, but that never happens. I'm not clear on why. I thought the way it's set up here, everything on the left should be higher priority.
The behavior I'm working on seems pretty simple. It's for a gun turret. The basic idea is, if the player is directly in front of the turret, I shoot the player. If the player is roughly in front, but not exactly lined up, I rotate to aim at the player. Otherwise, I go idle. Here's the behavior as I set it up:
The problem is, what happens is that the behavior gets stuck in the "Gun Turret Aim At Player" action. Here's the action:
C#:
public override TaskStatus OnUpdate()
{
TurretRotation.SetTarget(_playerTransform.position);
return TaskStatus.Running;
}
My understanding is that the "Can See Target (Narrow)" condition (which is what checks if the player is straight ahead) should be interrupting the
Gun Turret Aim At Player" action, but that never happens. I'm not clear on why. I thought the way it's set up here, everything on the left should be higher priority.