deadmilk
|
  |
| Joined: 02 Nov 2015 |
| Total Posts: 112 |
|
|
| 10 Nov 2015 06:36 PM |
| How would I detect if a player is roughly facing an object, like not turning their back to it. |
|
|
| Report Abuse |
|
|
deadmilk
|
  |
| Joined: 02 Nov 2015 |
| Total Posts: 112 |
|
| |
|
|
| 10 Nov 2015 06:41 PM |
| Could you define "facing" a little better? |
|
|
| Report Abuse |
|
|
Zaxerion
|
  |
| Joined: 09 Feb 2013 |
| Total Posts: 2304 |
|
|
| 10 Nov 2015 06:42 PM |
I am thinking of this:
Get the angles of both CFrame(s), compare the angles with % to check if they are similar. If so, they are "rougly" facing an object.
Give me a minute and I will write some pseudo code.
Hello, I am Zaxerion. I like to make cool things to show off in Script Builder! |
|
|
| Report Abuse |
|
|
Zaxerion
|
  |
| Joined: 09 Feb 2013 |
| Total Posts: 2304 |
|
|
| 10 Nov 2015 06:44 PM |
--define angles by getting both there angles
do the following check for x,y ,z
if angles.X%50/50 == angles2.x then --if y and z then --blah
my approach is probably all wrong :)
Hello, I am Zaxerion. I like to make cool things to show off in Script Builder! |
|
|
| Report Abuse |
|
|
nox7
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 27467 |
|
|
| 10 Nov 2015 07:00 PM |
Simple.
-- LocalScript local Part = ? local Cam = workspace.CurrentCamera
local _, IsOnScreen = Cam:WorldToViewportPoint(Part.Position)
if (IsOnScreen) then
end |
|
|
| Report Abuse |
|
|
deadmilk
|
  |
| Joined: 02 Nov 2015 |
| Total Posts: 112 |
|
| |
|