Code not working

Hi for some reason our coding is not cooperating with our game

Do you have any advice?

Here is the coding

event block when arrow collides with yellow cylinder
in enter is 30 data and set text of new text to 30

event block when arrow collides with red cylinder
in enter is 10 data and set text of new text to 10

event block when arrow collides with black cylinder
in enter is 5 data and set text of new text to 5

Hi @4804223978,

Please, share your CoSpace so we can take a look at what is not working.
Here is a sharing video tutorial: https://www.youtube.com/watch?v=rRB3kStIH_A

I can’t find the share button on my game. Is it because I am in a teachers class?

Yes,
If you are a student, please ask your teacher to enable sharing for you :slight_smile:

Or you can select the code and save it as an image. That will also help

Thank you, I will ask!

Hi @4804223978 ,

Please, check the answer to the similar question in this topic.

It didnt work :sleepy:

This is it we want it to add points if you touch and target but we can make all points add up it only gets the lowest amount. (yellow=30) (red=20) (black=10)

Thanks

Hi @4804223978,

I looked into your space and the idea is awesome. I have made some fixes to make it run smoother.

  1. I have replaced the target and constructed it from tubes. Otherwise the arrow sometimes moves too fast, goes deep into target and collides with two cylinders at the same time
  2. The arrow bounding box is too big. Sometime it touches target area that visually should not be touched. I have added thin cylinder to the arrow position and attached it to arrow, so they move simultaneously. And I check collision between target and that cylinder. That gives me more accurate behavior
  3. It is better to stop the arrow before moving it to the new point. Otherwise two movements add up.

Feel free to remix the space and explore code fixes