How do I use an arbitrary expression for a condition?

0 favourites
  • 3 posts
  • I need to have, as a condition, a test for the distance between the sprite and a certain target point.

    Currently I'm doing it in this ugly way:

    Four conditions:

    target X < self.X + 10

    targetX > selfX - 10

    targetY < self.Y + 10

    targetY > self.Y - 10

    This works but I feel like if I could have an arbitrary expression, then I could simply have one condition that went something like Distance(self.X, self.Y, targetX, targetY) < 10

    But what kind of condition do I need to make where I can enter an arbitrary condition. This seems like a very powerful thing one could do (arbitrary expressions on a particular obect for a condition. But I don't see a way to do it.

  • It's under "system" when adding a condition. The two relevant ones are:

    "Compare" and "pick by comparison". The first one doesn't do any object picking.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks that eliminated my issue at a rate of one issue per second.

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