Skip to content

Commit 77a7afd

Browse files
committed
fix sprite material initialization
when the material is a pac material inside the sprite, initialization order messes up and leaves an invalid material, so waiting for the material to exist and reassign it seems to fix it
1 parent 3f44d6d commit 77a7afd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lua/pac3/core/client/parts/sprite.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ end
7272

7373
function PART:Initialize()
7474
self:SetSpritePath(self.SpritePath)
75+
if not IsValid(self.Materialm) then
76+
timer.Simple(0, function() self:SetSpritePath(self.SpritePath) end)
77+
end
7578
end
7679

7780
function PART:SetSpritePath(var)

0 commit comments

Comments
 (0)