- Home /
Creating an enemy that can go towards lights
Hi Unity community!
I am making a first person exploration game where the player travels through the dark with 5 flares. The flares spawn a point light into the world.
There is a wraith hunting the player that can pass through walls, and it is attracted to the light from the flares. The player can throw flares into any area to distract the wraith.
My current idea for accomplishing this is to have the monster able to detect the location of the point lights in the world, in addition the player's location. The creature's movements will be based on a vector that averages out the location of these objects. The goal is to simulate the wraith going towards the area with the most light.
Does this sound like the right approach? I've tried to look for examples on my own, but have not had any luck so far. My experience with scripting and Unity is limited, but I am very eager to learn.
What you described sounds fine, in principle at least. What part do you need help with?
Your answer
Follow this Question
Related Questions
Enemy AI Movement Decision Making 1 Answer
Basic 2D movement C# - Key presses cancel eachother out 4 Answers
Movement vector does not take the gravity vector.. 2 Answers
2D Pathfinding Top Down 0 Answers