Advertisement

C# Scripting: Help!

Started by September 08, 2018 07:14 PM
1 comment, last by frob 6 years, 2 months ago

Hello!

I'm a student in a Game Design class, and I need help with a primitive game that's due tonight. It's my first time using vectors, Dot products, and 3D space.

The object of the game is simply to sneak past the NPC and reach the goal without being spotted. I'm currently writing script for the NPC, which I intend to have a "cone" of vision, as well as a maximum visibility distance. I've worked out distance with relative ease, but I haven't figured out how to create a field of view for the NPC to spot the player within. I need help with a solution for this mechanic. I'm not intending for anyone to solve it for me, but I've hit a wall, and am at the point where I cannot complete this without asking for help. I'm building in Unity.

Any feedback is GREATLY appreciated.

Hopefully you've learned the lesson to start your homework earlier, and the lesson to talk with your instructor.  You are paying your instructor to help you, so let them help you.

 

That being said, if you're still looking for answers this many hours later, a few questions:

1) What have you tried, and what were the results that didn't work?

2) What do you understand about a field of view? Is it something you can describe to us? Can you describe it with math formulas? This is important, because if you struggle to explain it to fellow humans, you're going to struggle even more to explain the algorithm to a computer. 

This topic is closed to new replies.

Advertisement