you can use following bp:
place that code in your ai bp and in place of cast to character use your player character.