hey, quick question but

id: 749361

category: Questions about Scratch

posts: 6

Anic120 Anic120 loading
I've seen other games do it but how do you make a backdrop follow your mouse in a smooth way? like if you put your cursor in the corner, your backdrop will slightly follow?
IceCreamTub IceCreamTub loading
Should probably be in HELP WITH SCRIPTS, but whatever
The BACKDROP In Question is actually SPRITE btw

when green flag clicked
set rotation style [Don't rotate v]
forever
go to x: (0) y: (0)
point towards [Mouse Pointer v]
move ((distance to [Mouse Pointer v])/[10]) steps // you can set it to be a higher number if you want it to be more subtle
end

IceCreamTub wrote:

Should probably be in HELP WITH SCRIPTS, but whatever
The BACKDROP In Question is actually SPRITE btw

when green flag clicked
set rotation style [Don't rotate v]
forever
go to x: (0) y: (0)
point towards [Mouse Pointer v]
move ((distance to [Mouse Pointer v])/[10]) steps // you can set it to be a higher number if you want it to be more subtle
end
If the OP meant how to make the backdrop just gently move towards the mouse, then this code could be used:
(Yet again, the background has to be a sprite for this to be work.)
when green flag clicked
forever
go to x: ((mouse x) / (10)) y: ((mouse y) / (10)) //You can change the 10s to whatever number you'd like.
end
Anic120 Anic120 loading
Here is a project that I've seen do it since the code does not work.


I can't really figure out how the project poster actually did it - but here.

https://scratch.mit.edu/projects/939317139

C&P if the link is not working.

Like a parallax?
Anic120 Anic120 loading