Help with your scripting

GetDistance

GetDistance

Postby cassius_b » 18 Apr 2018, 23:12

Is there a function to get the distance between two entities, such as the player and an enemy entity?
cassius_b
Skyline Ensen
 
Posts: 154
Joined: 21 Mar 2016, 13:45
Skill: 3D Modeller
Skill: Programmer

Re: GetDistance

Postby SolarPortal » 19 Apr 2018, 01:40

Code: Select all
distance = entity.getDistance(objID, targetID);


or

Code: Select all
distance = entity.getDistanceToVector(objID,x,y,z);


https://api.aurasoft-skyline.co.uk/classentity.html#a646cf8b5a7abd57e09b8db5f6b1ca6bd

Hope this helps
Skyline Game Engine - Lead Dev.
Please provide as much info as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 4770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860

Twitter: @SolarPortal
Instagram: @SolarPortal
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: GetDistance

Postby cassius_b » 19 Apr 2018, 20:16

Yes. that will help. Thanks.
cassius_b
Skyline Ensen
 
Posts: 154
Joined: 21 Mar 2016, 13:45
Skill: 3D Modeller
Skill: Programmer


Return to Lua Scripting

Who is online

Users browsing this forum: No registered users and 4 guests

cron