Is there a way to make a character/NPC only target people in a specific range in front of him(not through walls if you can) and chase them down? I just want to know, requesting how is simply impossible and I am not a expertise at scripting.
Can NPC have a scripted eyesight system?
1 answer
You could add two lines coming from the NPC's head, and weld them to look like they're on the face decal. Then, whenever the NPC move's its head, or moves its body, and those invisible bricks hit something, you can code it to chase what it hit. OR, simply use region3, I am really new to region3, so I don't really know how to explain this, sorry. So, the two lines would work PERFECTLY, because they'er amazingly ranged. And, if you would like to not make the lines go through walls, just make it so if they hit a wall, the lines don't work until the touch ended (wall.TouchEnded) Simple!
5 comments
Hopefully I helped!
But that means they can only see from 2 tiny slots. Not what's directly in front of them. Instead I'd use rays instead of parts http://wiki.roblox.com/index.php?title=Ray. It'll be easier and less cumbersome.
And we're not allowed to give help to people who don't follow the rules because that's kinda like rewarding for breaking the rules.
Pretty cool but rays like LordDragonZord said would make it much more perfectly for sight. But, if the player is in range but the script hits the wall even if the player is not through it, that could be a issue.
Are you saying I am breaking the rules? I'm pretty sure it's not since I am not requesting for something like asking for a script.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
This topic is incredibly confusing to me so I hope someone may answer this and that I may understand.
You should learn some coding basics first and then work on this when you're more comfortable with studio and scripting. Also, it's against the rules here for us to make free scripts especially because we're doing this all for free. So you need to supply your own code that we can FIX not help make.