Remember me
You are here: HomeForumCyberix3D ForumReport a bugError #3615
Welcome, Guest
Username: Password: Remember me

TOPIC: Detecting objects in within range?

Detecting objects in within range? 3 years 10 months ago #2660

  • minionboy565
  • minionboy565's Avatar
  • OFFLINE
  • Junior Boarder
  • Behold the truth ...and perish.
  • Posts: 20
  • Thank you received: 4
How do I detect if an object (such as a cube) is within a specific radius of another object?
In other words, how do I check if the distance between the two objects is below a certain number?

For example, if I made an explosion with a radius of 600, and I wanted to fling objects within the 600 range of the explosion. Is there a way to detect if a cube or other model is within the 600 range of the explosion?

Thanks.
¹⁰¹¹⁰⁰⁰¹¹⁰¹⁰¹¹⁰¹¹¹⁰¹⁰¹⁰⁰¹¹⁰¹¹⁰⁰¹⁰¹⁰¹¹¹¹⁰¹⁰⁰¹⁰¹⁰¹¹⁰⁰⁰¹¹⁰¹⁰¹¹⁰¹¹(01101000 01100101 01101100 01101100 01101111 00100000 01101001 00100111 01101101 00100000 01101101 01101001 01101110 01101001 01101111 01101110...
The administrator has disabled public write access.

Detecting objects in within range? 3 years 10 months ago #2663

  • cyberix3d
  • cyberix3d's Avatar
  • OFFLINE
  • Administrator
  • Posts: 703
  • Thank you received: 697
Hello,
Here is an example for measuring distance using the Math.distance function.
www.gamemaker3d.com/player?pid=01635755
For explosion, you can add an explode function inside each object that uses the Impulse command if the distance is near.
Regards,
Cyberix3D team
The administrator has disabled public write access.
The following user(s) said Thank You: minionboy565

Detecting objects in within range? 3 years 9 months ago #2690

  • minionboy565
  • minionboy565's Avatar
  • OFFLINE
  • Junior Boarder
  • Behold the truth ...and perish.
  • Posts: 20
  • Thank you received: 4
Great, thanks!
¹⁰¹¹⁰⁰⁰¹¹⁰¹⁰¹¹⁰¹¹¹⁰¹⁰¹⁰⁰¹¹⁰¹¹⁰⁰¹⁰¹⁰¹¹¹¹⁰¹⁰⁰¹⁰¹⁰¹¹⁰⁰⁰¹¹⁰¹⁰¹¹⁰¹¹(01101000 01100101 01101100 01101100 01101111 00100000 01101001 00100111 01101101 00100000 01101101 01101001 01101110 01101001 01101111 01101110...
The administrator has disabled public write access.
Time to create page: 0.074 seconds