Editing and Customization > Modding Help

[Solved] What Type of Measurement does GEUtil.DistanceBetween() Return?


The function takes two entities. When I pass it two players to find out what the distance between the two are when one is killed, it returns a float. I could be what seems like 10 feet away from the victim when I kill them, and it may say 127.XXXX.  The comments don't specify the type of measurement, though 10 feet would equate to 120 inches, so maybe it's a measurement for virtual inches?

In Source, 1 unit = 0.75 inches. You can read more about dimensions in the Source engine in this article.

Awesome! Thanks for the info and reading material. I'm definitely new to working with the Source engine, so it'll help.

You really shouldn't think of it in terms of real-world dimensions. Its a unit, nothing more nothing less. Just get comfortable visualizing what 100, 500, and 1000 units looks like in game and go from there.

Good reference points: Players are 72 units tall and 12.5 units in diameter, Floor-to-ceiling heights are generally 128 units.

So if you want something to happen within 10 "player widths" away, simply put in 125.


[0] Message Index

Go to full version