#I'm creating a unit, but the inventar doesn't work for it and it automatically attacks

1 messages · Page 1 of 1 (latest)

swift plume
#

I wrote a unit that I summon with the help of a command, the problem with this unit is that when I give him items, he can't use them, but when he gives them to me, I can, and he also constantly automatically attacks everyone next to him

orchid walrus
#
  1. it's not your unit, perhaps your ally, try creating unit via lua methods such as CreateUnitByName
    it accepts an "owner" parameter, set it to your hero,
    you can also change it by SetOwner later
  2. most units have an "AcquisitionRange", which determines the radius they become aggressive when enemy approaches
    declare an AttackAcquisitionRange in unit kv
    also can be changed by lua later
orchid walrus
swift plume
orchid walrus
#

what example? lua code?

swift plume
#

Yes, the code in which all this could be implemented, or the project

orchid walrus