|
| 11 Oct 2016 12:04 AM |
The Method I have been using works through walls so yea.
|
|
|
| Report Abuse |
|
|
anaIyze
|
  |
| Joined: 29 May 2014 |
| Total Posts: 2048 |
|
| |
|
|
| 11 Oct 2016 12:44 AM |
Maybe I am not clear. How do I find out whether a part or brick is on the player's screen.
|
|
|
| Report Abuse |
|
|
anaIyze
|
  |
| Joined: 29 May 2014 |
| Total Posts: 2048 |
|
|
| 11 Oct 2016 12:51 AM |
| what I would do is make a script that clones all parts that are seen by them on their playerGui onto a "screen" (ScreenGui) & continuously update it so it follows the exact same position as it does on the playerGui (use runService) |
|
|
| Report Abuse |
|
|
NotAshley
|
  |
| Joined: 16 Jan 2014 |
| Total Posts: 14257 |
|
|
| 11 Oct 2016 01:02 AM |
you can use the camera's WorldToViewportPoint method to see if a Vector3 position is being rendered in the bounds of the player's camera. make sure to check every corner of the brick so that it will count as visible even if only a little bit of it is on the screen. then to make sure it's not obstructed by any walls, use raycasting.
http://wiki.roblox.com/index.php?title=API:Class/Camera/WorldToViewportPoint http://wiki.roblox.com/index.php?title=Raycasting
|
|
|
| Report Abuse |
|
|
|
| 11 Oct 2016 01:20 AM |
How would I use Raycasting to do this?
|
|
|
| Report Abuse |
|
|
NotAshley
|
  |
| Joined: 16 Jan 2014 |
| Total Posts: 14257 |
|
|
| 11 Oct 2016 07:56 PM |
cast a ray from your camera to each corner of the brick. if all the rays collide with something before they hit the brick, then the view of the brick is clearly obstructed
|
|
|
| Report Abuse |
|
|
Wowgnomes
|
  |
| Joined: 27 Sep 2009 |
| Total Posts: 26255 |
|
|
| 11 Oct 2016 08:10 PM |
raycast + field of vision + Lookvector
|
|
|
| Report Abuse |
|
|