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: Camera Focus

Previous Thread :: Next Thread 
inception101 is not online. inception101
Joined: 19 Dec 2010
Total Posts: 738
19 Dec 2015 10:44 AM
How would I make a script that detects what the player is looking at, and if the object has a IntValue called "interactive" set to 1 then it fires a function called Blah()
Report Abuse
Waccsadac is not online. Waccsadac
Joined: 02 Jun 2012
Total Posts: 2440
19 Dec 2015 10:48 AM
havent tested

local cam=workspace.CurrentCamera
workspace.CurrentCamera.Changed:connect(function()
local check= Instance.new("Part",workspace)
check.CFrame=cam.Focus
local touched = check:GetTouchingParts
for i=1, #touched do
if touched[i].interactive == 1 then
Blah()
return
end
end
end)
Report Abuse
Waccsadac is not online. Waccsadac
Joined: 02 Jun 2012
Total Posts: 2440
19 Dec 2015 10:49 AM
before return do test:Destroy()
Report Abuse
inception101 is not online. inception101
Joined: 19 Dec 2010
Total Posts: 738
19 Dec 2015 10:58 AM
So this pretty much just creates an invisible part touching where the player is looking then it calls the part from there? Seems very inefficient...
Report Abuse
Waccsadac is not online. Waccsadac
Joined: 02 Jun 2012
Total Posts: 2440
19 Dec 2015 11:02 AM
i could probably find a more efficient way brb
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