Jump to content
Rick

FreeMaterial isn't working

Recommended Posts

Is there a way to free a material in lua? I've tried FreeMaterial(mat) and mat:Free() and both give me an error saying they don't exist.

Share this post


Link to post

just simply set the material to nil... but you also have to remove it from wherever it was being used by either freeing the mesh or painting that mesh a different material.

Share this post


Link to post

So can I technically do that with all LE entities? Why have :Free() for other entities like meshes then?

 

Please do not add tags in the thread title.

 

Sorry I didn't see a Lua forum but other languages have one so thought I'd give it some more info in the generic forum.

Share this post


Link to post

The other language subforums are closed for new topics. They'll be merged into the main programming forum soon.

 

Entities require manual freeing because they have too many linkages to ever be collected by the GC. I'm not a big fan of GC because of things like this.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...