Attachable: self.RootID = self.ID? What?
Now I'm modding a sniper gun, which uses Lua to charge and fire bullets.
So I added an attachable with Lua script:
to the HDFirearm:
and then used:
if not self.gun then
if self.RootID == self.ID then
mo = MovableMan:GetMOFromID(self.RootID);
if IsHDFirearm(mo) then
self.gun = ToHDFirearm(mo);
to check it. It print "3", the RootID of the attachable is its self.ID.
The attachable thing did attach to the gun in game. Oh and, even with DrawAfterParent = 0, it showed beyond the sniper. What's wrong?