collision between two actors but only part of the body.

yog1

  • Posts: 19
I create a football game, I want the ball touches the leg and then will push action.
collision between two actors but only part of the body.

I create a football game, I want the ball touches the leg and then will push action

Until now I did colision between 2 actor (player and the ball) ... but it's not good,
That even if the ball touches a player at the top that makes the act of a kick.

So what can you do?
Thanks in advance.

Innes

  • *
  • Posts: 1961

  • Create a new collision group called 'leg'.
  • In the Collision tab for the actor, add a new collision shape for the leg area of the actor and ensure that it is selected (i.e. click on it).
  • Look in the right panel, where you will you will see the 'Physical Properties' section.
  • Click on the 'Group' drop down list and select the 'leg' group.

You can now detect when the ball collides with the 'leg' group.
Visit www.TheStencylBook.com - the only published book for learning Stencyl.

yog1

  • Posts: 19
Thank you so much !!! You're a genius!

One question: how to do in event of the ball. The command: "If the ball touches in the leg"

I mean: colision between the player (group leg) to the ball

Innes

  • *
  • Posts: 1961
One question: how to do in event of the ball. The command: "If the ball touches in the leg"

I mean: colision between the player (group leg) to the ball

Add an event to an actor (or actor behavior) to detect a collision with a group, as shown in the attached image.
Visit www.TheStencylBook.com - the only published book for learning Stencyl.

yog1

  • Posts: 19
tnx!!!
but its not work for me.

i need collisions betwen "ball" and "leg group" (on "player")..

i add event on ball...collisions betwen member(ball) of group ..."leg"
its not work.

Innes

  • *
  • Posts: 1961
Try inserting a debug print block above the push block to determine if the collision is being detected.
Visit www.TheStencylBook.com - the only published book for learning Stencyl.

yog1

  • Posts: 19
I do not understand what you mean ... sorry .. you can explain other words


Innes

  • *
  • Posts: 1961
Put a [print] block inside the collision detection block. Test the game. Look in the log viewer to see if the print message is being displayed.
Visit www.TheStencylBook.com - the only published book for learning Stencyl.