Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Help Getting X and Y position of a Sprite!
- microscratchy
-
New Scratcher
10 posts
Help Getting X and Y position of a Sprite!
I am trying to get both the x and y position of a sprite on Scratch 3.0, but I have noticed a difference when comparing it to Scratch 2.0. I can't seem to find the following block which was available in Scratch 2.0 on Scratch 3.0. The following block is shown below
Did they remove this block in the new Scratch 3.0? Is there another block that performs the same function? If anyone can please let me now I would greatly appreciate it!
Thank you
([ v] of [Sprite1 v])
Did they remove this block in the new Scratch 3.0? Is there another block that performs the same function? If anyone can please let me now I would greatly appreciate it!
Thank you
- gor-dee
-
Scratcher
1000+ posts
Help Getting X and Y position of a Sprite!
It's still there….for me at least
- microscratchy
-
New Scratcher
10 posts
Help Getting X and Y position of a Sprite!
Interesting…because on my “Sensing” blocks I only have the following:
-touching(mouse-pointer)?
-touching color () ?
-color() is touching () ?
-distance to (ouse-pointer)
-ask(what's your name") and wait
-answer
-key(space) pressed?
-mouse down?
-mouse x
-mouse y
-set drag mode(draggable)
-loudness
-timer
-reset timer
-backdrop# of (stage)
-current
-days since 2000
-username
I still can't find it
If possible can you confirm if you have the same blocks under “Sensing”? I appreciate it
Thank you
-touching(mouse-pointer)?
-touching color () ?
-color() is touching () ?
-distance to (ouse-pointer)
-ask(what's your name") and wait
-answer
-key(space) pressed?
-mouse down?
-mouse x
-mouse y
-set drag mode(draggable)
-loudness
-timer
-reset timer
-backdrop# of (stage)
-current
-days since 2000
-username
I still can't find it

If possible can you confirm if you have the same blocks under “Sensing”? I appreciate it
Thank you
- T_om
-
Scratcher
19 posts
Help Getting X and Y position of a Sprite!
Interesting…because on my “Sensing” blocks I only have the following:
-backdrop# of (stage)
Right there. Click on the drop-down button next to stage. You can then select a sprite.
- SimpleScratch
-
Scratcher
500+ posts
Help Getting X and Y position of a Sprite!
The new equivalent block In scratch 3 is the forth one from the bottom in the sensing category
Last edited by SimpleScratch (Jan. 13, 2019 12:00:26)
- microscratchy
-
New Scratcher
10 posts
Help Getting X and Y position of a Sprite!
Ahh I see it now. I appreciate the help! Thank you all!

- JBecsa24
-
Scratcher
1 post
Help Getting X and Y position of a Sprite!
]
Last edited by JBecsa24 (Jan. 30, 2019 01:49:18)
- genesch
-
New Scratcher
3 posts
Help Getting X and Y position of a Sprite!
The new equivalent block In scratch 3 is the forth one from the bottom in the sensing category
Yeah, but it doesn't allow you to check for the sprite that is being controlled. The drop down menu doesn't have the sprite you're writing the script for - it has all the other sprites, so you can have it do something based on the actions of a different sprite, but not itself. So… ummm?
- deck26
-
Scratcher
1000+ posts
Help Getting X and Y position of a Sprite!
Every sprite has built-in variables x-position and y-position!The new equivalent block In scratch 3 is the forth one from the bottom in the sensing category
Yeah, but it doesn't allow you to check for the sprite that is being controlled. The drop down menu doesn't have the sprite you're writing the script for - it has all the other sprites, so you can have it do something based on the actions of a different sprite, but not itself. So… ummm?
Last edited by deck26 (April 18, 2019 13:12:59)
- genesch
-
New Scratcher
3 posts
Help Getting X and Y position of a Sprite!
Every sprite has built-in variables x-position and y-position!The new equivalent block In scratch 3 is the forth one from the bottom in the sensing category
Yeah, but it doesn't allow you to check for the sprite that is being controlled. The drop down menu doesn't have the sprite you're writing the script for - it has all the other sprites, so you can have it do something based on the actions of a different sprite, but not itself. So… ummm?
Ummm… yeah, but how do you check it? If I have a sprite called Sprite1, and I want to see if it's in the top 25% of the screen, the drop down menu doesn't have the Sprite1 as an option for the name. It only has the “Stage” as the drop down option. Soooo…?
Last edited by genesch (April 18, 2019 13:47:29)
- deck26
-
Scratcher
1000+ posts
Help Getting X and Y position of a Sprite!
if <(y position) > [90]> then
end
- genesch
-
New Scratcher
3 posts
Help Getting X and Y position of a Sprite!
if <(y position) > [90]> then
end
Ahhh!!! That makes sense. Very different from Scratch 2.. Thanks!!
- deck26
-
Scratcher
1000+ posts
Help Getting X and Y position of a Sprite!
No, Scratch 2 was exactly the same.if <(y position) > [90]> then
end
Ahhh!!! That makes sense. Very different from Scratch 2.. Thanks!!
- Fizzmaker123
-
New Scratcher
2 posts
Help Getting X and Y position of a Sprite!
Interesting…because on my “Sensing” blocks I only have the following:
-backdrop# of (stage)
Right there. Click on the drop-down button next to stage. You can then select a sprite.
When I went on that it cannot select a sprite?
- deck26
-
Scratcher
1000+ posts
Help Getting X and Y position of a Sprite!
Just doing this do get a big pile up!No, this isn't a playground.
Join In!
The sensing block includes the other objects in the project. If you only have one sprite and copy the sensing block to that sprite's scripting area it will only show the stage. Add a sprite and it will also be shown.
- --Explosion--
-
Scratcher
1000+ posts
Help Getting X and Y position of a Sprite!
You can make a new sprite, select the main sprite from the drop down and then drag that block into the coding area and drop it. Then drag the block you have in the coding area of the second sprite on top of the main sprite's icon. Hope I helped!The new equivalent block In scratch 3 is the forth one from the bottom in the sensing category
Yeah, but it doesn't allow you to check for the sprite that is being controlled. The drop down menu doesn't have the sprite you're writing the script for - it has all the other sprites, so you can have it do something based on the actions of a different sprite, but not itself. So… ummm?
- mroam
-
Scratcher
5 posts
Help Getting X and Y position of a Sprite!
Ah-hah; the “x position” and “y position” and “direction” of the current sprite are in the dark blue section of “Motion” blocks, in Scratch 3 as they were in Scratch 2.
You don't need to use " of (sprite)“ from the light blue section of ”Sensing“ blocks, which doesn't show the current sprite anyway.
(Yes, to get x position of ”myFavoriteSprite“ you can go to another sprite and choose the light blue ” of (myFavoriteSprite)“ and then drag it back onto myFavorite sprite, but the dark blue ”x position" is shorter, simpler, and easier to get (once you know where to look), especially for showing to students.)
You don't need to use " of (sprite)“ from the light blue section of ”Sensing“ blocks, which doesn't show the current sprite anyway.
(Yes, to get x position of ”myFavoriteSprite“ you can go to another sprite and choose the light blue ” of (myFavoriteSprite)“ and then drag it back onto myFavorite sprite, but the dark blue ”x position" is shorter, simpler, and easier to get (once you know where to look), especially for showing to students.)
- IoT-Ted
-
Teacher
2 posts
Help Getting X and Y position of a Sprite!
I'm new and am trying to learn Scratch from a Todd Perkins Scratch (2) Programming course on LinkedIn Learning (fka Lynda.com), and I'm having a hard time reproducing his first ‘Costumes’ tutorial, done on Scratch 2, that has the ‘x position of Sprite 1’ that is no longer a sensing option in Scratch 3.
I do quite understand the thread explanations. Is there anywhere where I might see the Todd Perkins' Scratch costumes tutorial done in Scratch 3, using the methods you guys describe in this thread?
I found his project here How would this look remixed with Scratch 3?
Any help would be greatly appreciated.
Thanks you!
IoT-Ted
I do quite understand the thread explanations. Is there anywhere where I might see the Todd Perkins' Scratch costumes tutorial done in Scratch 3, using the methods you guys describe in this thread?
I found his project here How would this look remixed with Scratch 3?
Any help would be greatly appreciated.
Thanks you!
IoT-Ted
Last edited by IoT-Ted (Dec. 28, 2019 05:27:53)
- IoT-Ted
-
Teacher
2 posts
Help Getting X and Y position of a Sprite!
I developed a couple of work arounds here. It solves my questions and moves the sprite with the space bar as in Todd's original tutorial. Any feedback is welcome.
Thank you
https://scratch.mit.edu/projects/356351611/
Thank you
https://scratch.mit.edu/projects/356351611/
- Madcatofdoom
-
Scratcher
500+ posts
Help Getting X and Y position of a Sprite!
I developed a couple of work arounds here. It solves my questions and moves the sprite with the space bar as in Todd's original tutorial. Any feedback is welcome.Please don't necropost. Make your own topic instead!
Thank you
https://scratch.mit.edu/projects/356351611/
- Discussion Forums
- » Help with Scripts
-
» Help Getting X and Y position of a Sprite!








