My solution was almost identical to Sam’s, except that I set the Aiming variable on Perception Change, instead of on Tick. There was a note about how casting on Tick isn’t a great idea, so I’m guessing it’ll be rewritten in a future lecture to be similar to what I did (or to cache the Character on Begin Play or something).
As an unrelated note, I’ve seen comments on how people don’t like the various mistakes that are in the videos (regardless of whether they were intentional mistakes), and I just wanted to weigh in on that. I think the mistakes are the single most important aspect of the course. Like, just a series of instructions of “do this, then that, then this other thing” is not helpful. What IS helpful is the reasoning behind why things are done, and also general tips for solving problems when they inevitably occur. Without those, we wouldn’t actually be in a very good position to make something after finishing the course. By knowing how to figure out what should be done next, and also how to work our way through issues, we’re able to actually put something together that works, which is ultimately the goal.
It seems like an awful lot of people seem to think that the goal is to make a Tank game, or a first person shooter. And I’m glad that the actual game is secondary to the important concepts of working with the engine to make things happen, and solve problems.
Anyway, that’s enough words. Here’s my AI Controller after adding to the end of the Perception Updated event. The duplicate nodes feel dirty, and if I didn’t already know we were going to re-do it, I’d probably make a function for it: