How to Create a Realistic NPC Eyesight System

,

(post deleted by author)

1 Like

Hello everyone! I completely rewrote this tutorial with better code and a cleaner layout.

2 Likes

Hi,
Can you provide a .rbxl or editable demo place?

Thanks

That defeats the purpose of following the tutorial!

3 Likes

Hey i want to tell you that This Eyesight script is literally useless in multiplayer,

The script stops looking to other players if it cant see the first or a player thanks to the “return”,

I would like you to remove the return and add the Check detectibles into them

1 Like

Hi,

Do you have a .rbxl file with a fix for the issue you mentioned?

Thanks

I don’t have time to edit this right now, however, thanks for the feedback.

I’d replace the return with a check of how many players are in the server and loop through them if there were more than one or return if there was only one and they weren’t detected.

I’ll make another reply when the script has been updated.

Thanks,
blvecoves

Hey, Sorry for late respond but i did fixed it however i cant really acces Roblox Studio right now so basically remove the return Checks and replace them with this :

if distance < ViewRange and angle < FieldOfView then
–rest of the last part
end

Hi, Thanks for seein my respond. I wrote it with such poor quality in grammar becuse i didnt expected a respond lol.

Thanks for your notice on this, Roblox really should add a feature where you can skip to next Instance in a Table!

You can, that’s what continue is for!

just replace the returns with continue

Thanks for the feedback! I’ve edited the tutorial.

Small Post Update

  • Fixed minor issues with the code’s formatting.