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: Server Lag

Previous Thread :: Next Thread 
OldGoldie is not online. OldGoldie
Joined: 17 Aug 2010
Total Posts: 8210
11 Jul 2015 12:30 AM
I have a

while RunService.Stepped:wait() do

loop in a LocalScript causing it.
It's for a custom camera, If I change it to a lower wait, or wait(), the camera doesn't look good at all.
Is there a way I can get rid of the lag, and still make the camera look good?

There isn't any output but this script causes lag.

local intTick=tick()
while RunService.Stepped:wait() do
local dif=tonumber(tick()-intTick) --Main value used for handling script speed in game.
intTick=tick()
local Cx,Cy,Cz=(head.Position.x-cam.CoordinateFrame.x)*(dif*8),((head.Position.y+distance)-cam.CoordinateFrame.y)*(dif*8), (head.Position.Z-cam.CoordinateFrame.z-4)*(dif*8)
cam.CoordinateFrame=CFrame.new(Vector3.new(cam.CoordinateFrame.x+Cx, cam.CoordinateFrame.y+Cy, cam.CoordinateFrame.z+Cz),Vector3.new(cam.CoordinateFrame.x+Cx,cam.CoordinateFrame.Y+Cy-8,cam.CoordinateFrame.Z+Cz+2))
end
Report Abuse
Chrapnel is not online. Chrapnel
Joined: 01 Feb 2014
Total Posts: 951
11 Jul 2015 12:32 AM
e.e this is dodgy on so many levels

what kind of camera are you going for?
Report Abuse
OldGoldie is not online. OldGoldie
Joined: 17 Aug 2010
Total Posts: 8210
11 Jul 2015 12:37 AM
Kind of like League of Legends' camera, it follows you from the sky, facing down on your head.

Example here: http://www.roblox.com/games/268544583/EpicPaperTowels-Place-Number-1
Report Abuse
ThaneTheCreator is not online. ThaneTheCreator
Joined: 08 Apr 2009
Total Posts: 2182
11 Jul 2015 01:03 AM
I've made things like that, and it usually seems that it's laggy in Studio but not in-game. Have you tested it in-game? And if you have and it's still laggy, it may just be due to your connection.

~who's awesome? you're awesome!
Report Abuse
OldGoldie is not online. OldGoldie
Joined: 17 Aug 2010
Total Posts: 8210
11 Jul 2015 01:21 AM
Nevermind, I found the problem.
Report Abuse
ThaneTheCreator is not online. ThaneTheCreator
Joined: 08 Apr 2009
Total Posts: 2182
11 Jul 2015 05:39 AM
:D What wus it?

~who's awesome? you're awesome!
Report Abuse
duckwit is not online. duckwit
Joined: 08 Aug 2008
Total Posts: 1310
11 Jul 2015 05:52 AM
Top Tip: When you want to synchronise the camera with a part whose physics are distributed (i.e. not exclusively local), use the :GetRenderCFrame() method of BasePart.

The ROBLOX client interpolates the physical information about the movement of parts so that it looks smoother than it actually is. When you refer to somePart.CFrame you're getting the CFrame of where it actually is in physical space. When you use somePart:GetRenderCFrame() you get the exact CFrame of where that part appears to be relative to the client.

This can help mitigate some the synchronicity issues when cameras follow a target.
Report Abuse
ThaneTheCreator is not online. ThaneTheCreator
Joined: 08 Apr 2009
Total Posts: 2182
11 Jul 2015 05:56 AM
/\ Thanks dude, I'll use that in the future.

~who's awesome? you're awesome!
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