Distance(Specific sprite)

This forum is currently in read-only mode.
From the Asset Store
Minimal Sprite Font with Stroke for Pixel Art games.
  • Is there a way to make the distance event reference a specific instance of a sprite?

    distance(Object.X, Object.Y, Cloud.X, Cloud.Y)

    Say i have 10 Clouds, but want the distance to a specific one?

  • This is what object picking is for.

    Here's the relevant wiki entry:

    http://sourceforge.net/apps/mediawiki/c ... ct_picking

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • well obviously since its an expression for use in an action its going to run within the context of certain conditions, those determine which object is used/picked.

    (when i say object i mean sprite)

    the conditions (things on the left) will specify under what conditions (hence the name) the objects will be picked, and then for every object that meets those conditions the actions referencing those objects or using them in anyway, be it through object specific actions, or through an expression reference like sprite.x will select the object(s) meeting the conditions.

    this question is kind of odd to me, i feel your probably having a specific problem that would be better answered if you told us what it is. you need to build your conditions so that you refer to specific instance of the object, you cant just use ALWAYS and expect it to work, you either need to use variables, or some other circumstance under which the desired instance(s) will be picked

    if your using system compare, that might be the source of your problem, since no instance of cloud can be specified. try making cloud have a variable with its distance, then comparing that instead. assuming this is the problem, of course. That way any cloud with 'PV distance' greater than X will be picked.

    im not sure what else i can say.

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