generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Facing a part?

Previous Thread :: Next Thread 
deadmilk is not online. 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 is not online. deadmilk
Joined: 02 Nov 2015
Total Posts: 112
10 Nov 2015 06:37 PM
?*
Report Abuse
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
10 Nov 2015 06:41 PM
Could you define "facing" a little better?
Report Abuse
Zaxerion is not online. 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 is not online. 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 is not online. 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 is not online. deadmilk
Joined: 02 Nov 2015
Total Posts: 112
10 Nov 2015 07:14 PM
Thanks @nox7!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image