Finding distance between two objects?

This forum is currently in read-only mode.
From the Asset Store
This is a Dungeon Master tool & the 1st of 12 Combat Engines from the Building Combat Engines for Browser Games workshop
  • Hey there, I want to find the distance between two objects, and use that distance so that if its less than a certain amount, a certain something will happen.

    Also, How would I create this, at the moment I have a zombie, and if it has LOS to the Player, it will set a waypoint at the players position. However this causes the zombie to move to the players last position, and makes the game easy to play. I want to have it so that the zombie will always move towards the players current position, and not going to its last waypoint before doing so.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Distance(Object1.x,Object1.y,Object2.x,Object2.y) Will give you the distance between 2 objects.

    Could you not simply update the Zombie's waypoint every second or so as your player is moving?

  • Even when I do that, the zombie still has to go to the past waypoint before it chooses to create another at the player. Previous waypoints are not overwritten by new ones.

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