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: We need an local event that runs before each frame

Previous Thread :: Next Thread 
TNOMCat is not online. TNOMCat
Joined: 02 Aug 2011
Total Posts: 156
03 Jun 2013 05:05 AM
The title is pretty much all I have to say
Report Abuse
Aerideyn is not online. Aerideyn
Joined: 16 Jan 2010
Total Posts: 1882
03 Jun 2013 05:56 AM
why?
Report Abuse
Salvatorem is not online. Salvatorem
Joined: 26 May 2013
Total Posts: 83
03 Jun 2013 06:00 AM
For what purpose?
Report Abuse
RaidenJPN is not online. RaidenJPN
Joined: 22 May 2013
Total Posts: 6920
03 Jun 2013 06:10 AM
Why in the world would we ever need something as preposterous as this?
Report Abuse
TNOMCat is not online. TNOMCat
Joined: 02 Aug 2011
Total Posts: 156
03 Jun 2013 06:54 AM
Faith in scripters lost
Report Abuse
Radioaktiivinen is not online. Radioaktiivinen
Joined: 25 Apr 2009
Total Posts: 18629
03 Jun 2013 06:56 AM
local onFrame={on=false,connect=function(self,fun) self.on=true Spawn(function() while self.on do fun() end end) end, disconnect=function(self) self.on=false end}


onFrame:connect(function() print("GERMEHÖRD A FRAME") end)
wait(10)
onFrame:disconnect()
Report Abuse
TNOMCat is not online. TNOMCat
Joined: 02 Aug 2011
Total Posts: 156
03 Jun 2013 07:09 AM
Radio, wouldnt that freeze the game?
Report Abuse
Cadthrenal is not online. Cadthrenal
Joined: 10 Oct 2008
Total Posts: 38
03 Jun 2013 07:36 AM
Like this if u cry every Tim.
--
Signature
Report Abuse
Radioaktiivinen is not online. Radioaktiivinen
Joined: 25 Apr 2009
Total Posts: 18629
03 Jun 2013 07:50 AM
throw in a wait() in the loop
Report Abuse
TNOMCat is not online. TNOMCat
Joined: 02 Aug 2011
Total Posts: 156
03 Jun 2013 07:55 AM
then it has a 0.03 second delay, not before every frame
Report Abuse
TNOMCat is not online. TNOMCat
Joined: 02 Aug 2011
Total Posts: 156
03 Jun 2013 08:11 AM
And by frame i mean, every time it draws a new frame on the screen. So with an event like that you can make stuff move before it gets rendered so there is no delays
Report Abuse
Radioaktiivinen is not online. Radioaktiivinen
Joined: 25 Apr 2009
Total Posts: 18629
03 Jun 2013 08:13 AM
But the game works at 30 FPS, graphics framerate is completely separated from the game, it doesnt even exist from the games point of view.
Report Abuse
Radioaktiivinen is not online. Radioaktiivinen
Joined: 25 Apr 2009
Total Posts: 18629
03 Jun 2013 08:14 AM
If its for a gui you can use gui tweening though, it might be a render-side thing and be in sync with the graphics.
Report Abuse
TNOMCat is not online. TNOMCat
Joined: 02 Aug 2011
Total Posts: 156
03 Jun 2013 08:19 AM
The game is locked to 60 fps. Connecting currentcamera changes to a function that moves a brick will move it like it should if you are rotating your camera in first person, but that doesnt get fired when the camera moves (changes position)
Report Abuse
Ravenshield is not online. Ravenshield
Joined: 21 Nov 2007
Total Posts: 4143
03 Jun 2013 08:34 AM
Don't know if this is what you're searching for..
http://wiki.roblox.com/index.php/Stepped_(Event)
Report Abuse
TNOMCat is not online. TNOMCat
Joined: 02 Aug 2011
Total Posts: 156
03 Jun 2013 08:38 AM
Raven that fires only every 1/30 of an second which is 0.0333 which is also wait().

Also an event that runs every time the camera changes (position too) would do pretty much the same trick that the pre-render event would but that would only work for things hooked to the camera.
Report Abuse
Radioaktiivinen is not online. Radioaktiivinen
Joined: 25 Apr 2009
Total Posts: 18629
03 Jun 2013 08:40 AM
Everything is still synced with the physics, and the physics attempts to run at 30 FPS.

Roblox cannot really add something like that without either making it a really special case with tons of limitations (you cannot for example change any game objects mid-frame, as physics and all are running at that point i guess) which would make it useless, or by bumping the physics frame rate to 60 FPS (performance would take a hit even though it could be avoided to some degree)
Report Abuse
TNOMCat is not online. TNOMCat
Joined: 02 Aug 2011
Total Posts: 156
03 Jun 2013 08:49 AM
It would be nice if the camera.changed would fire on position changes too
Report Abuse
noliCAIKS is not online. noliCAIKS
Joined: 08 Mar 2010
Total Posts: 917
03 Jun 2013 08:51 AM
I believe RunService.Heartbeat fires before each frame and RunService.Stepped after each frame.
If you're out of ideas, you can always use coroutine.yield() to get 100-10000 FPS.
Report Abuse
TNOMCat is not online. TNOMCat
Joined: 02 Aug 2011
Total Posts: 156
03 Jun 2013 09:12 AM
Heartbeat is also 0.03333 seconds.
Report Abuse
Radioaktiivinen is not online. Radioaktiivinen
Joined: 25 Apr 2009
Total Posts: 18629
03 Jun 2013 09:13 AM
He wants it to be synced with graphics updates instead of physics updates, which is impossible.
Report Abuse
TNOMCat is not online. TNOMCat
Joined: 02 Aug 2011
Total Posts: 156
03 Jun 2013 09:24 AM
and yield loop has also similiar speed compared to wait().

I shall stick with camera changed event and predicting the character movement to attach a thing to the camera.
Report Abuse
VirtualUser is not online. VirtualUser
Joined: 16 Aug 2010
Total Posts: 533
03 Jun 2013 10:23 AM
Too good for GUIs?
Report Abuse
uyjulian is not online. uyjulian
Joined: 29 Nov 2012
Total Posts: 1214
03 Jun 2013 10:52 AM
Multi-threaded?
Report Abuse
RyanDolan123 is not online. RyanDolan123
Joined: 05 Mar 2009
Total Posts: 17919
03 Jun 2013 02:35 PM
gui = Instance.new("ScreenGui",game.StarterGui)

while wait() do
Spawn(function()
print("lol")
end)
Instance.new("Frame",gui)
end



There it executes that before each frame
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