0 Favourites

attract object

  • Hello, I want to do that when the two balls collide they attract, but works in Example 1, but not 2, and it is the latter that I want to get.

    first example

    <img src="http://i57.tinypic.com/2m464jc.png" border="0" />

    In this example just by being near attract

    Second example

    <img src="http://i59.tinypic.com/21mgkgk.png" border="0" />

    And here's what I want to achieve, which when touched, will attract, not before.

    sorry for the english, it's embarrassing

  • I don't understand your issue. In example 2, it's waiting on a collide, which means there isn't much distance for the object to attract too as they are already touching.

    Do you have a capx you can share?

  • If you want them to "stick together" when they collide ? Try...

    <img src="https://dl.dropboxusercontent.com/u/143636437/examples%20for%20web/Ashampoo_Snap_2014.02.15_15h00m11s_001.png" border="0" />

  • The problem is that in the first example, before colliding attract, but in the second example but not attract collide ... I want to be attracted when they collided.

    Also put part of the first example to the second example, but neither works ... I do wrong?

    RamPackWobble I do not want them to stick, I want to be attracted then stick <img src="smileys/smiley5.gif" border="0" align="middle" />

  • so you have worked out how to do the attracting ? (your part 1 ?)

    I have a way to "lock" them together once they touch....

    All you need to do is put the stick after your attract...

    You might (probably will) need to also turn off the attract once they are together or the force of the attract will start to push them around (I suggest a boolean along the line of

    if close enough and boolean "stuck together" is not set then apply force towards the other one

    collision ? apply distance joint and set boolean to true.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • I have tried everything and there is no way ... I'm going crazy. Are you a private message

  • I have tried everything and there is no way ... I'm going crazy.

    I bet you a pint you haven't and a second pint there is ? <img src="smileys/smiley1.gif" border="0" align="middle">

    Does your part one attract as you want it to ?

    Does the physics distance joint stick them together when they collide ?

    If they do work (separately) as you want them to then all you have to do is combine them...

    separate events. your part one followed by my suggestion.

    try it - if it doesn't work post your capx.

    is this what you are after ?

  • In your example attract the balls before they collide and it is just the opposite <img src="smileys/smiley36.gif" border="0" align="middle" />

    When the balls collide they attract not before <img src="smileys/smiley12.gif" border="0" align="middle" />

  • version 2

    version 3

    I am not sure what you want - in post 4 you said "RamPackWobble I do not want them to stick, I want to be attracted then stick" - which is what I did?

    Anyway - let me know if version 2 or 3 are close (I now think it is 3...)

  • In both examples, I want you to attract and not stick... is similar to the video that you pass.

    I'll leave it as impossible <img src="smileys/smiley6.gif" border="0" align="middle" /> thanks <img src="smileys/smiley18.gif" border="0" align="middle" />

  • Ok so when collided if distance is greater than a certain amount apply force?

  • Exactly when the balls collide, have a range where the two balls are attracted at once.

    It's funny because it works without me having to hit, but when they hit does not work <img src="smileys/smiley29.gif" border="0" align="middle" />

  • so you want

    "I want to be attracted then stick" and "I want you to attract and not stick..." ? We must be losing something in the translation to English.

    How about a drawing of what you want ?

    "attract when close but stop attracting when too close" ?

  • I want that when the balls collide they attract, but there is a little bounce before sticking ...

    I also like that when the two balls collide attract at the same point.

    You might as well put in the last link, but when they clash will attract each other

    Sorry to be so heavy, if not understand me, try something else.

  • you pass me the examples? I'll manage it, as there is no way to understand <img src="smileys/smiley6.gif" border="0" align="middle" />

    Thanks for your help, for anything here I am <img src="smileys/smiley2.gif" border="0" align="middle" />

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)