- Joined
- Jul 26, 2008
- Messages
- 1,009
Alright I have a system that sets the facing of a unit in game. Unfortunately it's not very accurate (I don't think...)
You have to type in face ### twice to get it to work on buildings. Is there a better/easier way to set the facing of a building in game? (It works just fine on regular units)
You have to type in face ### twice to get it to work on buildings. Is there a better/easier way to set the facing of a building in game? (It works just fine on regular units)
JASS:
function UnitFacingEnumUnitSelected takes nothing returns nothing
if IsUnitSelected(GetEnumUnit(), udg_TEMP_Player) then
if IsUnitType(GetEnumUnit(), UNIT_TYPE_STRUCTURE) then
call UnitRemoveType(GetEnumUnit(), UNIT_TYPE_STRUCTURE)
call SetUnitPosition(GetEnumUnit(), GetUnitX(GetEnumUnit()), GetUnitY(GetEnumUnit()))
call SetUnitFacing(GetEnumUnit(), udg_TEMP_Real)
call UnitAddType(GetEnumUnit(), UNIT_TYPE_STRUCTURE)
else
call SetUnitFacing( GetEnumUnit(), udg_TEMP_Real)
endif
endif
endfunction
Last edited: