Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » script to keep sprite on a moving platform?
- Jedi_Edrich
-
11 posts
script to keep sprite on a moving platform?
Does anyone know a simple script to keep a sprite on a moving platform. Not looking for something overly complicated. Thanks!
- wkelly42
-
100+ posts
script to keep sprite on a moving platform?
Assuming that the platform moves 1, do this:
Basically, all you do is make sure that the sprite moves the same as the platform as long as it's touching the platform. That's what I did in my Frogger clone (https://scratch.mit.edu/projects/56306968/). This way, you can move OFF the platform once you're on it.
- JSE2001
-
100+ posts
script to keep sprite on a moving platform?
Does anyone know a simple script to keep a sprite on a moving platform. Not looking for something overly complicated. Thanks!
Maybe you can do this: (make sure you have slope detection in you platforming script)
- Jedi_Edrich
-
11 posts
script to keep sprite on a moving platform?
Thanks for the tips - I will try these.
- Finnthebest12
-
100+ posts
script to keep sprite on a moving platform?
try this
Last edited by Finnthebest12 (July 16, 2015 14:41:42)
- JSE2001-TEST
-
12 posts
script to keep sprite on a moving platform?
Did you see the link I posted on your profile? There is a working version of the script, please look!
- Specter22
-
100+ posts
script to keep sprite on a moving platform?
Check out Shaun's Platform Game https://scratch.mit.edu/projects/21899025/ it has moving platforms.
Check out the whole course.
Check out the whole course.
- gtoal
-
1000+ posts
script to keep sprite on a moving platform?
is the platform moving up and down, or sideways like a conveyor belt? Does anyone know a simple script to keep a sprite on a moving platform. Not looking for something overly complicated. Thanks!
in any case, whatever x/y delta is being applied to the platform, the same offset should be applied to the player assuming it is touching the platform. taking care to move the character in the same refresh cycle as the platform, before both are drawn together. (to avoid jittering)
- Pancake_Boy616
-
6 posts
script to keep sprite on a moving platform?
nope doent work on scratch 3.0Does anyone know a simple script to keep a sprite on a moving platform. Not looking for something overly complicated. Thanks!
Maybe you can do this: (make sure you have slope detection in you platforming script)
- best-games-ever
-
500+ posts
script to keep sprite on a moving platform?
Please don't Necropostnope doent work on scratch 3.0Does anyone know a simple script to keep a sprite on a moving platform. Not looking for something overly complicated. Thanks!
Maybe you can do this: (make sure you have slope detection in you platforming script)
- DerpyHead0
-
1000+ posts
script to keep sprite on a moving platform?
this topic is from 2017, if you are having issues, make a new topic. nope doent work on scratch 3.0
also, every script can only work when it's put in the right place. are you sure it's in the correct loop, in the right sprite, and that this is what you need for your situation?
i assume the problem is that your platform moves up and down, is using some costume movement setup, or your player isn't colliding with it correctly.
- hoi_man
-
1 post
script to keep sprite on a moving platform?
who says no necro posting lol
- 677784A
-
8 posts
script to keep sprite on a moving platform?
everyone exept you who says no necro posting lol
Last edited by 677784A (June 7, 2020 00:00:55)
- balmerazTSC
-
26 posts
script to keep sprite on a moving platform?
to make it so it doesn't teleport to the middle of the platform, you could do this:
You can get the
https://scratch.mit.edu/projects/414840806/editor/
You can get the
block from old projects, and backpack it. here is a project that I made that has that block:
https://scratch.mit.edu/projects/414840806/editor/
- cavemanster
-
100+ posts
script to keep sprite on a moving platform?
make a variable called “resting x speed” set this to zero if you aren't on a moving platform and set this to the speed of the moving platform you are on (if you are on a moving platform.) Now, for all the movement scripts along the X axis, instead of changing the x by a certain amount, change the x by the wanted amount + resting x speed.
- ScratchCatHELLO
-
1000+ posts
script to keep sprite on a moving platform?
uygv77tvy
is the platform moving up and down, or sideways like a conveyor belt? Does anyone know a simple script to keep a sprite on a moving platform. Not looking for something overly complicated. Thanks!
in any case, whatever x/y delta is being applied to the platform, the same offset should be applied to the player assuming it is touching the platform. taking care to move the character in the same refresh cycle as the platform, before both are drawn together. (to avoid jittering)
nope doent work on scratch 3.0Does anyone know a simple script to keep a sprite on a moving platform. Not looking for something overly complicated. Thanks!
Maybe you can do this: (make sure you have slope detection in you platforming script)
who says no necro posting lol
to make it so it doesn't teleport to the middle of the platform, you could do this:
You can get theblock from old projects, and backpack it. here is a project that I made that has that block:
https://scratch.mit.edu/projects/414840806/editor/
make a variable called “resting x speed” set this to zero if you aren't on a moving platform and set this to the speed of the moving platform you are on (if you are on a moving platform.) Now, for all the movement scripts along the X axis, instead of changing the x by a certain amount, change the x by the wanted amount + resting x speed.
Guys. This post is from 2015. Please stop necroposting.
this topic is from nope doent work on scratch 3.02017, if you are having issues, make a new topic.
also, every script can only work when it's put in the right place. are you sure it's in the correct loop, in the right sprite, and that this is what you need for your situation?
i assume the problem is that your platform moves up and down, is using some costume movement setup, or your player isn't colliding with it correctly.
*2015
.
- joshuaho
-
1000+ posts
script to keep sprite on a moving platform?
Hey folks - thanks for helping out! However, this topic is old (from 2015) - so I doubt the topic owner is still looking for answers. I would suggest looking for newer threads (that still need to be answered) and respond to those instead. 

- CoolCrafter1231
-
100+ posts
script to keep sprite on a moving platform?
this would the character to go straight to the platform and trap the player in the platform try this
- Discussion Forums
- » Help with Scripts
-
» script to keep sprite on a moving platform?