Discuss Scratch

TAGGERUNG_JUSKA
Scratcher
5 posts

Error, server overload, or Scratch 3?

Hey, I have a slight problem. I'm trying to make a sprite follow the mouse pointer, something I've done dozens of times, but I believe this is the first time on scratch 3. the script is simple, when start pressed, forever, go to mouse pointer. When run, this script causes IMMENSE lag to the game. I used to have a “go to front layer” block in there with the “go to mouse pointer” block, but I took it out thinking it was causing the lag, which it wasn't. I added a “wait 0.1 seconds” block, and the lag cleared up just fine, but the sprites movement was horrible. (also if I remove the script from the game it runs butter smooth) I am using a high-end computer, so I doubt its that, and my internet connection is great. Any ideas of what might be causing this?

StrangeMagic32
Scratcher
1000+ posts

Error, server overload, or Scratch 3?

not quite sure what may be happening, but you could try
go to x: (mouse x) y: (mouse y)

glide (0) secs to x: (mouse x) y: (mouse y)
TAGGERUNG_JUSKA
Scratcher
5 posts

Error, server overload, or Scratch 3?

Hmmm… I tried both those methods (thanks by the way ) and they all had the same result: extreme lag.
TAGGERUNG_JUSKA
Scratcher
5 posts

Error, server overload, or Scratch 3?

I'm gonna go try and cause the same lag on a project with nothing on it, maybe that'll yield some interesting results…


OK, I could not cause the game to lag. I even dumped a bunch of sprites doing useless random things on stage, and it still ran great.



Here's something interesting… I let the original game run and the lag is only apparent when sprites are changing size or ghost effect, NOT when changing costumes, preforming tasks, etc. how very odd. (the first half of the project so far is all sprites changing size and ghost effect and I never let it get to the part where the sprites were actually preforming tasks)

Last edited by TAGGERUNG_JUSKA (July 13, 2019 22:53:02)

CodeNerdCO
Scratcher
100+ posts

Error, server overload, or Scratch 3?

Could you give me the link?
Nambaseking01
Scratcher
1000+ posts

Error, server overload, or Scratch 3?

Hmm… Try the following script.



Hopefully this helped, and bye!
TAGGERUNG_JUSKA
Scratcher
5 posts

Error, server overload, or Scratch 3?

Welp, I tried that script and it still caused the mystery “lag”. (also, I need the sprite to be upright, with your script it is pointing at the mouse pointer and slowly/quickly moving towards it… and when it reaches the mouse pointer it kinda goes nuts and starts wriggling… you know what I mean)
TAGGERUNG_JUSKA
Scratcher
5 posts

Error, server overload, or Scratch 3?

CodeNerdCO wrote:

Could you give me the link?

Link?
StrangeMagic32
Scratcher
1000+ posts

Error, server overload, or Scratch 3?

TAGGERUNG_JUSKA wrote:

CodeNerdCO wrote:

Could you give me the link?

Link?
the web link to the project
a-jar-of-tuna
Scratcher
100+ posts

Error, server overload, or Scratch 3?

Are there any of these you can implement to reduce the lag?

Scratch Wiki wrote:

Preventing lag in Scratch
There are a multitude of ways to lower the lag in the Scratch program, such as:

using vector graphics
avoiding the use of detailed vector graphics in motion
avoiding the use of cloning
using fewer sprites
spreading out scripts across other sprites
limiting the amount of objects visible at one time
using custom blocks to fit long and similar scripts
https://en.scratch-wiki.info/wiki/Lag#Preventing_lag_in_Scratch

Powered by DjangoBB