How to make a man touch a random object when moving

how to make a man touch a random object when moving


blocks

or moved depending on the number, for example if 3 then

this variant doesn’t work well
blocks (4)

blocks (2)

someone can help me

please elaborate… I do not understand…
who is the “man”? the user, who is using your app?
what is moving? some sprites?
Taifun

yes it’s sprites moving and the other sprite is a human, it should randomly touch with other

You mean like in this example where the character moves and pick different objects ?

not quite so, I need a random sprite to interact with a little man when interacting with a certain sprite, events will occur
component_event

it is necessary to collide with a random sprite and not with each

I do not understand clearly what you want but first make a list of sprites.

Then pick a random one. .Name it current sprite. then make the little man interact with the current sprite.

Then you can put" pick a random sprite" block anwhere you want.

[quote=“Andrei_Anatol, post:1, topic:168618”]
this variant doesn’t work
blocks (4)
blocks (2)

Mate, what do you wanna do exactly?
Ok. There is a little man and there are four shapes.
What is this little man doing in the first place?
What is the story? Tell us step by step then someone will surely help you.

blocks (2)
blocks (1)
blocks (3)
blocks (4)
blocks (6)
blocks (7)
on each sprite I want to put an event
blocks (9)

please answer these questions
how does that game work?
Taifun

sprites are moving towards the little man, I want to attach an event to each sprite, and so that these events work randomly when interacting with the little man

what about explaining this more in detail, so we are able to understand?

what I understand is: sprites are moving towards the little man… the little man is also moving or not moving? depending on the movement of the sprites probably one of them will collide with the little man, this is your random part, isn’t it?.. then one of the Collided event happens… so where is the problem? do what you want to do in the Collided events

Taifun

I need a random collision, but I get everything collide
blocks (11)
blocks (10)
blocks (9)

you are still not explaining in detail…

but not at the same time? or are all sprites very close to each other?
one of the sprites will collide with the little man, and later probably the other sprites, too
you might want to add a notifier as test to display for example “i1 collided with the little man”
so what should happen after the first sprite collides with the little man?

Taifun

after the collision, all the other sprites stop and a dialog box comes out, then I press the start button again, the sprites pass, and the random one collides again

this is how the sprites appear

i showed the blocks above how the sprites move and how they appear