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: CurrentCamera.Changed

Previous Thread :: Next Thread 
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
04 Mar 2015 11:03 AM
How would I run a function using CurrentCamera.Changed even when the angle of the camera changes? Currently, this doesnt fire .Changed when the angle is changed. Any solutions?


Offer on R$2,109 and send on 21,112 RAP
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
04 Mar 2015 11:11 AM
Unfortunately, you will probably need to monitor changes yourself. Changes made by internal Roblox stuff doesn't seem to fire Changed. Examples of this include parts velocity/position changing due to physics, unmodified camera rotating, character walking, et cetera.
Report Abuse
nomer888 is online. nomer888
Joined: 13 Feb 2010
Total Posts: 551
04 Mar 2015 11:15 AM
You could create a while loop checking if the camera's CoordinateFrame changed. Here's some pseudocode:

local function Changed()
-- Do stuff here.
end

local lastFrame = currentCamera.CoordinateFrame
local currentFrame
while RenderStepped:wait() do
currentFrame = currentCamera.CoordinateFrame
if (currentFrame ~= lastFrame) then
lastFrame = currentFrame
Changed()
end
end
Report Abuse
nomer888 is online. nomer888
Joined: 13 Feb 2010
Total Posts: 551
04 Mar 2015 11:20 AM
Nevermind, apparently the :wait() method in events does not return something that is not nil.

Replace 'while RenderStepped:wait() do' with:

while true do
-- Everything that was here before.
RenderStepped:wait()
end
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
04 Mar 2015 11:26 AM
The wait method in events returns the event parameters. So if you were doing PlayerAdded:wait() it would return the player.
Report Abuse
nomer888 is online. nomer888
Joined: 13 Feb 2010
Total Posts: 551
04 Mar 2015 11:28 AM
Oh, I didn't know that. Thanks for pointing that out!
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
04 Mar 2015 11:54 AM
The problem is that RenderStepped causes lag issues, so I dont want to use it. I currently have been, though.


Offer on R$2,109 and send on 21,091 RAP
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