Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » how to do if character A if touching character B block
- shuaiouke
-
100+ posts
how to do if character A if touching character B block
I need to detect if A in touching B as C
- shuaiouke
-
100+ posts
how to do if character A if touching character B block
someone help pls
- deck26
-
1000+ posts
how to do if character A if touching character B block
More detail rather than bumping after 2 minutes!
- DerpyHead0
-
1000+ posts
how to do if character A if touching character B block
can't you just have the stick detecting if it touches the player?
- shuaiouke
-
100+ posts
how to do if character A if touching character B block
but I have custom block in the C character cause I don't want to add a broadcast every time I add a new item
- deck26
-
1000+ posts
how to do if character A if touching character B block
You need to share so we can see the context.
- deck26
-
1000+ posts
how to do if character A if touching character B block
It's still not clear to me exactly what you're after.
The black block moves and touches the stick and you want to detect that but also want to detect it touching other sprites? Or do you want it to detect the costume of the sprite it is touching so you can add different items to an inventory?
If it's different costumes for the same sprite just give the custom block the costume name as a parameter. If you're detecting touching different sprites you can load their names in a list and loop through the list to see if you're touching the item.
The black block moves and touches the stick and you want to detect that but also want to detect it touching other sprites? Or do you want it to detect the costume of the sprite it is touching so you can add different items to an inventory?
If it's different costumes for the same sprite just give the custom block the costume name as a parameter. If you're detecting touching different sprites you can load their names in a list and loop through the list to see if you're touching the item.
- shuaiouke
-
100+ posts
how to do if character A if touching character B block
detect if black block is touching the stick in the inventory sprite
- deck26
-
1000+ posts
how to do if character A if touching character B block
Well obviously you can't do that - one of the two touching items need to detect the touch. (I'm ignoring the hacked blocks option here - no idea if that changes things.) But it's very easy to use a variable to indicate whether or not they are touching and the third sprite uses that as its detector which is all you need. detect if black block is touching the stick in the inventory sprite
Last edited by deck26 (Oct. 28, 2018 12:01:21)
- shuaiouke
-
100+ posts
how to do if character A if touching character B block
That's a gooooooood idea I'm using it thank you 

- deck26
-
1000+ posts
how to do if character A if touching character B block
You've missed the point - spriteC is running the script when spriteA and spriteB are touching.
- iFluxx
-
100+ posts
how to do if character A if touching character B block
Sorry, my badYou've missed the point - spriteC is running the script when spriteA and spriteB are touching.
- BaaXander
-
16 posts
how to do if character A if touching character B block
maybe I need to detect if A in touching B as C
on the player
- Discussion Forums
- » Help with Scripts
-
» how to do if character A if touching character B block