WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Any way to get pet position? (https://www.wowinterface.com/forums/showthread.php?t=57490)

MinguasBeef 09-15-19 12:43 AM

Any way to get pet position?
 
Is there any way to get the pet position x/y/z?
I noticed UnitPosition does not work for pets.

I'd like to retrieve this to calculate distance from myself to get an idea of when it will despawn since pets despawn at ~100 yds.

jeruku 09-15-19 09:13 AM

UnitPosition now only works for yourself and party members outside of instances.

Pets aren't dismissed when they despwn so setting a flag when hooking Dismiss Pet, or action from its button(s), and hooking the OnHide of PetActionBar works when checking for despawn.

Xrystal 09-15-19 10:11 AM

There is this function.

https://wow.gamepedia.com/API_UnitDistanceSquared

It might work for you outside of certain areas.

MinguasBeef 09-15-19 02:42 PM

Quote:

Originally Posted by Xrystal (Post 333759)
There is this function.

https://wow.gamepedia.com/API_UnitDistanceSquared

It might work for you outside of certain areas.

Looks like that doesn't work on the pet unit either. Oh well.

Thanks for the help guys I guess what i'm trying to do is just not possible.

Urtgard 09-17-19 02:30 AM

If you just want to know approximately how far away your pet is, you can use IsItemInRange and IsSpellInRange.

That's how LibRangeCheck-2.0 works.


All times are GMT -6. The time now is 11:24 PM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI