Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] How to get distance to enemy?
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#2
RE: How to get distance to enemy?

asEntity refers to the name of the Entity as it is defined in the Level Editor.

A slightly better way to do it, though I don't know the exact syntax, would be to get the name of the entity that the Player is currently looking at, then pass that value into Player_GetDistanceToEntity(), otherwise you need to add conditionals for every specific entity.

PHP Code: (Select All)
tString entityName Player_GetFocusEntityName();      //Maybe?
float entityDist Player_GetDistanceToEntity(entityName);
cLux_AddDebugMessage(entityName " is " entityDist "f units away."false); 

Discord: Romulator#0001
[Image: 3f6f01a904.png]
(This post was last modified: 01-27-2017, 09:48 PM by Romulator.)
01-27-2017, 09:47 PM
Find


Messages In This Thread
RE: How to get distance to enemy? - by Romulator - 01-27-2017, 09:47 PM
RE: How to get distance to enemy? - by Abion47 - 01-27-2017, 11:59 PM



Users browsing this thread: 1 Guest(s)