How do I make an event that can tell how close an object is to a particular object?

0 favourites
  • 3 posts
From the Asset Store
This is a single chapter from the "Construct Starter Kit Collection". It is the Student Workbook for its Workshop.
  • I want to make an event that's basically "If player is within range of object1, then..."

    I understand that I can use turret behavior for this, but because I have multiple objects I cant indiscriminately have a "Turret has target" event. I have to specify which specific target it is, because there are different actions for each specific target.

    There are also different object/targets in the same layout

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello,

    you can simply use the condition "compare 2 values" which can be found in System. In the first value, enter the distance between the player and the object :

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

    then sets your comparaison type and finally the value to compare, which is going to be a distance in pixels.

  • Hello,

    you can simply use the condition "compare 2 values" which can be found in System. In the first value, enter the distance between the player and the object :

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

    then sets your comparaison type and finally the value to compare, which is going to be a distance in pixels.

    bless you

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