Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by
bloxxyz 274 Moderation Voter
9 years ago

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!

0
hard trigonometry. hard. PM SMOOTHBLOCKMODEL FOR THIS. DragonODeath 50 — 9y

1 answer

Log in to vote
4
Answered by 9 years ago

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

Ad

Answer this question