Fandom

WoWWiki

API GetUnitSpeed

104,637pages on
this wiki
Add New Page
Talk6 Share

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

WoW API < GetUnitSpeed

Added with WoW 3.0 0300Wrath-Logo-Small

UsageEdit

Returns a value representing the moving speed of a unit.

value = GetUnitSpeed("unit")

Parameters Edit

Arguments Edit

unit 
String - The unitId for which the speed information is returned. This has not been tested with all units but does work for "Player" units.

Returns Edit

value 
Number - value of the unit speed

Examples Edit

Player unit moving at 100% -- value = 7
Player unit moving at 175% -- value = 12.25
Player unit moving at 200% -- value = 14

Misc. Calculations Edit

7 * 1.75 = 12.25 so apparently 7 = 100%

For example, the following will put the speed in % into the variable s.

s = string.format("%d", (GetUnitSpeed("Player") / 7) * 100);

Also on Fandom

Random Wiki