-1

I am fairly new to Scratch. I am trying to get my sprite (Zookeeper) to follow a boat when clicked, but the sprite stays about 4 inches away. I have looked online but I can't find a solution. The costume is from Google, could that affect it?

wizzwizz2
  • 135
  • 9
  • 1
    Probably better fit for [Help with Scripts](https://scratch.mit.edu/discuss/7)... uploading an image from Google shouldn't have an affect, no. – Nebula Feb 15 '16 at 15:07
  • Could you please give us a link to the project? We can't really tell what's wrong unless we can see some code, and it might be a problem with the costumes. Also, this is a better fit for the [Help with Scripts](http://scratch.mit.edu/discuss/7) forum on the Scratch website; most of us don't use Scratch, and those who do are doing stuff like [Magic Custom Blocks](http://scratch.mit.edu/discuss/topic/1810). – wizzwizz4 Feb 15 '16 at 19:19
  • Just realised you're new to all of Stack Exchange. So, welcome to Stack Overflow. Don't take this the wrong way; everybody was new once, and to be honest, this is a pretty good first question. My first question had 4 downvotes, so compared to that, you're doing pretty well. If you add the code you have tried so far, we can help you more easily. :-) – wizzwizz4 Feb 15 '16 at 20:16

4 Answers4

2

It's hard to tell as I can't see your code, if you have a Scratch account we could continue the discussion there.

You could try changing the costume center.

If you are unsure about doing this follow the instructions below:

  1. Save a backup as this may change the positioning of the character (e.g. goto x,y).
    • On the online editor use: File, Download to your Computer.
    • If you are not using a web browser (Offline Editor)
  2. Go to the Costumes Tab and select the costume of your boat.
  3. Click the costume centre button and then click on the middle of your boat.
  4. Run your code again and click on your boat as normal. If it isn't fixed, repeat steps 2 and 3 with the zookeeper and the boat where they are (the boat will move when you change the centre).
  5. Now, change the position of the boat so that it is in the water.
  6. Now, rerun the code to make sure it works. (If the boat moves back to the shore, then remove and replace a goto block.)
wizzwizz2
  • 135
  • 9
1

It is hard to tell what the problem is without some example code (a link to the project would be preferable, or a screenshot if offline), but here are my ideas as to what the problem might be:

  1. Does the image have white blobs or a background around it?
    If you are using the <touching [sprite▼]> block, white around the costumes will make Scratch think they have touched before you can see that they have. Fill in the white with transparent.
  2. How much are you moving your sprite?
    You'll need to move (10) steps until they are touching, by using the repeat until <> block. Otherwise, it will just move once.
  3. Is the hat block connected up properly?
    You need to connect the When this sprite is clicked block to the top of the moving code.
  4. Is it pointing in the right direction? You might have to point towards [sprite▼] before you move, otherwise it will move forwards without pointing towards anything first.

It might not be any of these; please show us some code, or preferably the entire project, so that we can help you.

wizzwizz4
  • 6,140
  • 2
  • 26
  • 62
0

Go into the sprite menu, and into the sprite painter. There should be a tool there that sets the center of the sprite. Use this tool to center the sprite, and then test your script again. If it still does not work, then look at your script that makes it follow the boat, and shorten the distance.

GreenHawk1220
  • 133
  • 1
  • 10
0

Simply do like this

When this sprite clicked
   go to Sailboat

replace the name of sailboat with the name of your sprite

Seniru Pasan
  • 753
  • 1
  • 7
  • 13