EcIiptic
|
  |
| Joined: 12 Aug 2009 |
| Total Posts: 13737 |
|
|
| 11 May 2014 12:31 PM |
Okay. For what I want to make on my game, I need this:
A brick that has a script in it that prints "Someone is looking" when a camera can see the block.
Can someone share a link to the wiki for a guide on that, or simply tell me the event or what.
#Piano |
|
|
| Report Abuse |
|
|
ColdSmoke
|
  |
| Joined: 02 Jan 2012 |
| Total Posts: 5784 |
|
|
| 11 May 2014 12:33 PM |
there isnt an event for that
I'm pretty sure you would need to do some raycasting and stuff, but no way to tell whats on screen, unless you want to check if that person is in the direct center of the screen you could draw a ray using the lookvector of the camera |
|
|
| Report Abuse |
|
|
|
| 11 May 2014 12:33 PM |
I barely even touched camera in Lua, but my best guess is to use camera's .Focus property.
http://wiki.roblox.com/index.php/Camera_manipulation |
|
|
| Report Abuse |
|
|
EcIiptic
|
  |
| Joined: 12 Aug 2009 |
| Total Posts: 13737 |
|
| |
|
powertool
|
  |
| Joined: 01 Feb 2008 |
| Total Posts: 3771 |
|
|
| 11 May 2014 12:35 PM |
Get the look vector of the camera, and check whether the part is within 35 degrees left or 35 degrees right of it. If so, toss a ray cast from the camera to the part, and ensure that it doesn't hit anything in between.
If all of the above then print someone is looking. |
|
|
| Report Abuse |
|
|
Kingmouli
|
  |
| Joined: 28 Sep 2012 |
| Total Posts: 1292 |
|
|
| 11 May 2014 12:38 PM |
http://www.roblox.com/Forum/ShowPost.aspx?PostID=129990124
It's kinda the same thing, I think ^.^ |
|
|
| Report Abuse |
|
|