Trying to make an AI Character move to my player character with the MoveToActor function. Don’t know how to give the function to the AI character. Spent a few minutes trying stuff and got this. Player character is DCharacter, Ai character is DEnemy and DEnemy has AIController.h included
AAIController* controller;
ADCharacter* player = Cast<ADCharacter>(player);
controller->MoveToActor(player);
this gives me the error: Error C4700 uninitialized local variable ‘player’(and ‘controller’) used but the code doesn’t have any red marks.
was I close or am I completely wrong?