Sign in to follow this  
Luiz Bills

How disable impact

Recommended Posts

If your talking about one object being able to push another then set their immovable member to true. This will make it so whatever physics body hits that immovable object, the immovable object won't move. :)

Share this post


Link to post
Share on other sites

Hmm, so you want one object to pass through another object? I'm not quite sure what your initial question means. Could you try rephrasing or further explaining? Perhaps a hypothetical example would help.

Share this post


Link to post
Share on other sites

I am not sure what you are asking but if you do not want a body to stop when coming into contact with another you can use overlap instead of collide.

 

game.physics.arcade.overlap(sprite1, sprite2)

Share this post


Link to post
Share on other sites

You can also disable specific collisions by using the processCallback on collide:

game.physics.arcade.collide(player, obstacles, function(player, obstacle) {  // do something (if you want) when the collision happens (only if the next function returns true however)}, function(player, obstacle) {  // if this function returns false, then the collision does not occur, if it returns true, it does  if (player.isRoundPeg && obstacle.isRoundHole) {    return false;  }  return true;});

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.