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 » Scripting Helpers
Home Search
 

Too many moving GUI objects cause jittery movement?

Previous Thread :: Next Thread 
mjemje is not online. mjemje
Joined: 28 Mar 2009
Total Posts: 25787
22 Nov 2013 10:29 PM
Here's a test script I made that causes bullet objects to scroll downward from the top of the screen.

wait(2.5)
while true do
t = wait()
script.Parent.frame.Text = t
script.Parent.fps.Text = 1/t
for n = 1, 2 do
q = script.Parent.Parent.Parent.Bullet:clone()
q.Parent = script.Parent
q.PosX.Value = math.random(0,10000)/10000
q.Position = UDim2.new(q.PosX.Value, 0, q.PosY.Value, 0)
end
q2 = script.Parent:getChildren()
for i = 1, #q2 do
if q2[i].Name == "Bullet" then
q2[i].PosY.Value = q2[i].PosY.Value + (t * 0.1)
q2[i].Position = UDim2.new(q2[i].PosX.Value, 0, q2[i].PosY.Value, 0)
if q2[i].Position.Y.Scale > 1 then
q2[i]:destroy()
end
end
end
end

It works. GUI "Bullet" objects are randomly created and scroll down the screen until they disappear from view, at which point they are deleted. In local play, it's flawless unless I boost the n maximum value in the first repeat to something stupid so it spawns, say, 15 bullets instead of 2.
In normal play, however, bullets move in short leaps instead of the smooth movement seen in edit mode. Is this a simple limit of how ROBLOX works, or is there a way around it?
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
22 Nov 2013 10:33 PM
Use TweenPosition() http://wiki.roblox.com/index.php/TweenPosition_(Method)
Report Abuse
mjemje is not online. mjemje
Joined: 28 Mar 2009
Total Posts: 25787
22 Nov 2013 10:34 PM
I thought of that at one point, but tweening has a gui object move over a period of time. It's only after that period of time that the script will move on to tweening the next bullet, correct?
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
22 Nov 2013 10:36 PM
Check out the last example. I dont think so...
Report Abuse
mjemje is not online. mjemje
Joined: 28 Mar 2009
Total Posts: 25787
22 Nov 2013 10:40 PM
Edit: This is not the case. The script does not wait for a tween to finish before moving on.

However, tweening did not make the movement any smoother. Everything's still jittery.
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
22 Nov 2013 10:42 PM
(If you do want it to wait you can use the callback argument.)
Report Abuse
mjemje is not online. mjemje
Joined: 28 Mar 2009
Total Posts: 25787
22 Nov 2013 10:45 PM
Wait for what?
Wait for one bullet to tween before starting to move the next one?

No, I don't want that.
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
22 Nov 2013 10:46 PM
Note the IF in my sentence...

And why don't you just use Tweening...
Report Abuse
mjemje is not online. mjemje
Joined: 28 Mar 2009
Total Posts: 25787
22 Nov 2013 10:49 PM
Please read previous replies. I tried moving bullets via tweening; the jittering effect persisted.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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