Inaccurate Scrolling

if you scroll really fast you’ll notice that some objects scroll at different rates than others
why?
link: https://c.gethopscotch.com/p/110e6pgfn2
I’d prefer to make a topic for this because I’ve had this issue before


Solution to topic:

10 Likes

Weird. I haven’t done scrolling much before, so I’ve never experienced this issue.

4 Likes

Lemme check, also 2 post

2 Likes

This is rlly odd

2 Likes

I have no idea how to do scrolling so I don’t know how to fix this

1 Like

(@CodeHelp)(sorry if you’ve already seen this)

5 Likes

I can’t open the link. Sorry!

2 Likes

Hi @Nobody

This is a typical error I see quite often in HS. No worries though, it’s easy to fix. Care must be taken to ensure all of the objects are making the same positional updates during the same frame.

Your scroll “controller” is run by clone 25, but it’s controlling clones 9-35. That means clones 25-35 will update 1 frame before clones 9-24. It’s not noticeable unless you’re making fast movements.

Try changing the controller to clone 9 and all will be good.

Note: I assume you’re trying to make a game from 1 object. But I’ll still mention that this situation is why I have an object called “Main” in many of my projects. It’s always the first object and I use it for any control code. That ensures the variables it’s setting get done at the very beginning of a frame and I don’t have to think about it further. Well organized code can prevent a lot of headaches and troubleshooting :slightly_smiling_face: Happy Coding

11 Likes

that’s odd, why do clones 25-35 update later?

yes, it’s for a challenge/I feel like doing it

I’ll keep that in mind when doing other projects, thanks for helping:)

3 Likes

*before

1 Like

Take a look at a block diagram showing the sequence of events in the Player. (This is an image from a tutorial I started making a while back but quit working on when THT took away the ability to edit posts). Each blue block is an object (I.e., one of your clones, which are in sequential order) with all the When rules and code inside.

image

If object 2 controls the positions of all three, then 2 & 3 will reposition the same during one frame, but object 1 doesn’t “see” the changes made by the controller (object 2) until the next frame so it repositions 1 frame after objects 2 & 3.

Does that help?

4 Likes

ohh that makes sense

thanks again for helping:)

Well, you do have a whole game in one so I think it not uncommon for scrolling to be inaccurate

1 Like

the problem was solved by ThinBuffalo, it was something I can’t put into words but understand—it wasn’t the wholeGame factor of it:)


@TheCMStudios Clive in case someone else experiences this?

1 Like

Clear to close?

1 Like

yes

1 Like