So I have a blueprint which will fire when the enemy AI Senses the player. The problem is he is a melee character and I only want him to attack when he is within melee range of the player character. Still fairly new to blueprints so any help would be appreciated. Here’s what I have so far.
if((ActorLocation - EnemyLocation).Size() <= MeleeRange)
{
//execute your code
}
make these nodes:
- Vector - Vector (GetActorLocation - TargetCharacter->GetActorLocation)
- GetVectorLenght (or Size or however it is called (long time since I did BP, I do c++ now))
- <= (floats)
- Branch
Put one into 2
Put 2 into 3, with your melee range second
And execute your melee logic on the true branch
Hope this helps
1 Like