Discuss Scratch

shuaiouke
Scratcher
100+ posts

how to do if character A if touching character B block

I need to detect if A in touching B as C
ififplayeristouchingstickthenadditemstickdefineadditemitem
shuaiouke
Scratcher
100+ posts

how to do if character A if touching character B block

someone help pls
deck26
Scratcher
1000+ posts

how to do if character A if touching character B block

More detail rather than bumping after 2 minutes!
DerpyHead0
Scratcher
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
Scratcher
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
Scratcher
1000+ posts

how to do if character A if touching character B block

You need to share so we can see the context.
shuaiouke
Scratcher
100+ posts

how to do if character A if touching character B block

deck26
Scratcher
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.

shuaiouke
Scratcher
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
Scratcher
1000+ posts

how to do if character A if touching character B block

shuaiouke wrote:

detect if black block is touching the stick in the inventory sprite
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.

Last edited by deck26 (Oct. 28, 2018 12:01:21)

shuaiouke
Scratcher
100+ posts

how to do if character A if touching character B block

That's a gooooooood idea I'm using it thank you
iFluxx
Scratcher
100+ posts

how to do if character A if touching character B block

whenclickedforeveriftouchingstick?thenadditemstick
deck26
Scratcher
1000+ posts

how to do if character A if touching character B block

iFluxx wrote:

whenclickedforeveriftouchingstick?thenadditemstick
You've missed the point - spriteC is running the script when spriteA and spriteB are touching.
iFluxx
Scratcher
100+ posts

how to do if character A if touching character B block

deck26 wrote:

iFluxx wrote:

whenclickedforeveriftouchingstick?thenadditemstick
You've missed the point - spriteC is running the script when spriteA and spriteB are touching.
Sorry, my bad
BaaXander
Scratcher
16 posts

how to do if character A if touching character B block

shuaiouke wrote:

I need to detect if A in touching B as C
ififplayeristouchingstickthenadditemstickdefineadditemitem
maybe
iftouching stickv?thensomething
on the player

Powered by DjangoBB