# Checking if sprite is at an X & Y Coordinate?

**URL:** <https://community.thunkable.com/t/checking-if-sprite-is-at-an-x-y-coordinate/563801>\
**Category:** Questions about Thunkable X\
**Tags:** beginner, canvas\
**Created:** [April 20, 2020, 7:19pm UTC](https://community.thunkable.com/t/checking-if-sprite-is-at-an-x-y-coordinate/563801 "2020-04-20T19:19:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![uberfile986yv284](https://avatars.discourse-cdn.com/v4/letter/u/2bfe46/32.png) [@uberfile986yv284](https://community.thunkable.com/u/uberfile986yv284)\
**Post date:** [April 20, 2020, 7:19pm UTC](https://community.thunkable.com/t/checking-if-sprite-is-at-an-x-y-coordinate/563801/1 "2020-04-20T19:19:21Z")

</div>

Hello, I need help with checking the position of a sprite to see if it matches coordinates that I want it to be at, for example, I have a block that is located at 100,100 and when I move it to 50,50 I want to be able to check if it has been set to 50,50 with the click of a button, and if it hasn’t, it should let me know as well  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/1/51201e5849bf4dbe0c826e4342869d84d5d36140.png)

I’ve tried this, but I can’t get the block to lock into the if statement

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [April 20, 2020, 9:51pm UTC](https://community.thunkable.com/t/checking-if-sprite-is-at-an-x-y-coordinate/563801/2 "2020-04-20T21:51:32Z")

</div>

Hey @uberfile986yv284, welcome to the community and thanks for posting! 🧇

it doesn’t work because the if block only accepts a true/false input. that block would reurn a value.

instead, you would want to use something like:

if {[sprite 1’s X = 50] **and** [sprite 1’s Y = 50]}  
do set label ShowWinner text = “it’s in place”  
else set label ShowWinner text = “it’s not in place”

also, it looks as if you are using ThunkableX so i have moved this post to the appropriate forum #thunkable-cross

---

<div class="post-metadata">

**Author:** ![uberfile986yv284](https://avatars.discourse-cdn.com/v4/letter/u/2bfe46/32.png) [@uberfile986yv284](https://community.thunkable.com/u/uberfile986yv284)\
**Post date:** [April 20, 2020, 10:40pm UTC](https://community.thunkable.com/t/checking-if-sprite-is-at-an-x-y-coordinate/563801/3 "2020-04-20T22:40:03Z")

</div>

How would I go about doing that? is it possible to do with blocks or can i somewhere write my own code for it to function as I want it to? If not, can you post a screenshot of the blocks aligned like that, I don’t see a

```
if(sprite1.X == 50 & sprite1.Y == 50)

```

block

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 11:38am UTC](https://community.thunkable.com/t/checking-if-sprite-is-at-an-x-y-coordinate/563801/4 "2024-11-08T11:38:49Z")

</div>


