Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can I create mechanics similar to Don't Blink?

If you guys don't know what I'm talking about, here is the game:

http://www.roblox.com/games/155324688/Dont-Blink

Basically, the mechanic in the game is that players can look at other players called "Weeping Angels", and the angels will freeze when someone is looking at them. I just need to know how you guys think he made it possible to detect a humanoid looking at another humanoid or object. I assume it must be in first person, but I can't be positive.

I'm intermediate in scripting, 1 year experience, so I understand most terms, but bare with me if I don't understand something and need context or pointing in the right direction.

I'd just like to know what you guys think, and if you know lead me to a wiki article that can teach me the more advanced material to do this? It's for a game I'm developing where, when you look at a monster with a humanoid inside of it, it will detect you can see it on your screen and it will notify you with a GUI of what it is and a description.

I'm not asking for you to make it for me, or a script, just some ideas.

Thank you!

1 comment

0

hard trigonometry. hard. PM SMOOTHBLOCKMODEL FOR THIS.

1 answer

It's pretty easy to do with a function of camera, a lot of people don't know about it though

Vector3, bool : WorldToScreenPoint ( Vector3 worldPoint )

local camera = game.Workspace.CurrentCamera
local worldPosition = Vector3.new()
local screenPosition,  onScreen = camera:WorldToScreenPoint(worldPosition)

if onScreen then
	print'Player can see the point!'
else
	print'Player cannot see the point :('
end

You can do some really cool things with this, but keep in mind this is really intensive

This discussion is preserved as it was. New answers, comments, and votes are closed.