Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » I need help with a project that keeps triggering with invisible blocks.
- draft123
-
Scratcher
49 posts
I need help with a project that keeps triggering with invisible blocks.
So basically what happens is when a character is hidden, it is triggered with a if-then block (color) even when it is hidden… How can i stop this from happening? Thank you so much 

if <> then
<color [#0b1aee] is touching [#af100a] ?>
end
- sam10301
-
Scratcher
37 posts
I need help with a project that keeps triggering with invisible blocks.
It should not be doing that are you shure your code is not bugged. Could you share the project so i could see.
- mstone326
-
Scratcher
1000+ posts
I need help with a project that keeps triggering with invisible blocks.
Where or not a sprite is hidden it still detects touching color. Without seeing the project I can take a guess, otherwise, share your project for more specific advice.
You could create a variable that has the sprites current state (shown, hidden). Then only check for the color detection if the state is shown.
You could create a variable that has the sprites current state (shown, hidden). Then only check for the color detection if the state is shown.
Last edited by mstone326 (Jan. 7, 2020 03:18:17)
- draft123
-
Scratcher
49 posts
I need help with a project that keeps triggering with invisible blocks.
It's actually a pretty big project I am working on, (RPG game) and I don't really want to release until necessary. Also, I have downloaded a previous version that does not detect colors and works properly for some reason… It has the same exact code. Why is this? Is this just a visual glitch???? And if you could tell me… how can I create a variable that checks for color detection if the state is shown? Thanks.
- draft123
-
Scratcher
49 posts
I need help with a project that keeps triggering with invisible blocks.
Meant to say I have downloaded a saved version… Also if you could tell me how I could make the same colored portal react with different levels, instead of having to change the color every single time… That would be awesome… Right now I am using, If orange (color of the ball) is touching color pink, purple, or whatever, it changes backdrop and sets position of the ball to its starting position. This is actually a big hindrance since I can't really draw things in the background of the game… For example if I used a pink color portal, and drew a pink blossom tree (since background level is Japanese setting) it would just trigger to go back to level 3 say if I walked over the pink blossoms…. (it's a portal game like the previous flying balls, but way more advanced). Thanks a lot
Last edited by draft123 (Jan. 7, 2020 16:46:11)
- draft123
-
Scratcher
49 posts
I need help with a project that keeps triggering with invisible blocks.
Sorry last thing… I have an actual major bug right here (dont know if its a bug but its just weird):
Think of it like color orange is touching color dark brown instead…
Funny thing is these both activate as they should upon reaching the correct backdrop, but the problem is that the object appears before the orange ball even touches brown… upon reaching this backdrop it instantly appears. When It should still be hidden until I touch the color, but I am nowhere near that color until I move like 200 units to the right… There are no previous backdrops that have this color either… So nothing is triggering the color… Very strange…
Thanks
when green flag clicked
hide
when backdrop switches to [Timber Collection]
forever
if <color [#1a938d] is touching [#273c24] ? then
show
Think of it like color orange is touching color dark brown instead…
when backdrop switches to [Timber Collection]
forever
go to [Flying Ball]
end
when I receive [Collect Timber Complete]
hide
stop [other scripts in sprite]
Funny thing is these both activate as they should upon reaching the correct backdrop, but the problem is that the object appears before the orange ball even touches brown… upon reaching this backdrop it instantly appears. When It should still be hidden until I touch the color, but I am nowhere near that color until I move like 200 units to the right… There are no previous backdrops that have this color either… So nothing is triggering the color… Very strange…
Thanks
- draft123
-
Scratcher
49 posts
I need help with a project that keeps triggering with invisible blocks.
BTW important detail, the color of the sprite that is invisible is also the color that triggers the sprite to show. Since it is constantly on top of the orange ball… However, I thought it wouldn't trigger if it was invisible…. very strange… I should probably change the color of the sprite, but it would mess up the game since it has to be of the identical color to the thing that is supposed to trigger it to appear…. Also When I remove the “forever go to flying ball” block it doesn't trigger anymore…
Sorry, I know this is confusing but basically, invisible blocks are triggering color blocks. I want to stop this… I do not think invisible blocks trigger with contact to color, this is because invisible red blocks which make the orange ball go back do not trigger when the orange ball passes through the screen… This means that something else must be triggering this, or this is just a bug… HELP!
Thanks
Sorry, I know this is confusing but basically, invisible blocks are triggering color blocks. I want to stop this… I do not think invisible blocks trigger with contact to color, this is because invisible red blocks which make the orange ball go back do not trigger when the orange ball passes through the screen… This means that something else must be triggering this, or this is just a bug… HELP!
Thanks
Last edited by draft123 (Jan. 7, 2020 23:57:32)
- deck26
-
Scratcher
1000+ posts
I need help with a project that keeps triggering with invisible blocks.
https://scratch.mit.edu/projects/357777941/ shows that the block does detect color touching color even if the sprite running the block is hidden.
As @mstone326 has suggested using a variable to record the current show/hide state of the sprite is the easiest option.
As @mstone326 has suggested using a variable to record the current show/hide state of the sprite is the easiest option.
Last edited by deck26 (Jan. 8, 2020 09:18:34)
- NROLSQUID
-
Scratcher
35 posts
I need help with a project that keeps triggering with invisible blocks.
when green flag clicked
say (so what is this about what oh)
Last edited by NROLSQUID (Jan. 9, 2020 01:29:56)
- NROLSQUID
-
Scratcher
35 posts
I need help with a project that keeps triggering with invisible blocks.
when green flag clicked
say (sorry just like writing like this)
Last edited by NROLSQUID (Jan. 9, 2020 01:34:18)
- NROLSQUID
-
Scratcher
35 posts
I need help with a project that keeps triggering with invisible blocks.
<(50) = (30)>
- NROLSQUID
-
Scratcher
35 posts
I need help with a project that keeps triggering with invisible blocks.
<(50) > (20)
- NROLSQUID
-
Scratcher
35 posts
I need help with a project that keeps triggering with invisible blocks.
define <invisible>
if (<(50) = (40)>)
invisible?
else
invisible
Last edited by NROLSQUID (Jan. 9, 2020 01:46:12)
- NROLSQUID
-
Scratcher
35 posts
I need help with a project that keeps triggering with invisible blocks.
define <invisible?> ()
- NROLSQUID
-
Scratcher
35 posts
I need help with a project that keeps triggering with invisible blocks.
when green flag clicked
if <> then
else
end
- NROLSQUID
-
Scratcher
35 posts
I need help with a project that keeps triggering with invisible blocks.
when green flag clicked
say [maybe i don't know invisible] for (2) secs
- NROLSQUID
-
Scratcher
35 posts
I need help with a project that keeps triggering with invisible blocks.
when green flag clicked
say [maybe i don't know invisible] for (2) secs
- NROLSQUID
-
Scratcher
35 posts
I need help with a project that keeps triggering with invisible blocks.
when green flag clicked
play sound [fatrat - timelapse]
- NROLSQUID
-
Scratcher
35 posts
I need help with a project that keeps triggering with invisible blocks.
when I receive [game over]
forever
play sound [game over sound]
end
- NROLSQUID
-
Scratcher
35 posts
I need help with a project that keeps triggering with invisible blocks.
if <color [#879461] is touching [#9a75a4] ?> then
say [game over i lose]
end
- Discussion Forums
- » Help with Scripts
-
» I need help with a project that keeps triggering with invisible blocks.