Open CarsonKompon opened 10 months ago
SceneObject was made public at some point within ModelRenderer so you can technically do this now through
modelRenderer.SceneObject.SetMaterialOverride(myMaterial, "screen")
But it feels weird to have the SceneObject exposed like that (may just be me, there's probably other benefits to having it exposed)
For?
S&Box
What can't you do?
The ModelRenderer component has a MaterialOverride which overrides all materials in the rendered model. I instead want to override only one material.
How would you like it to work?
Same as you could before but instead directly with the component instead of interfacing with the SceneObject
https://asset.party/api/Sandbox.SceneObject.SetMaterialOverride(Material,string,int)
This function allows you to override the material of a screen on a tv if its material has the attribute "screen" set to
1
.What have you tried?
Making my own custom ModelRenderer component based on the code in previous versions of the scenetesting branch but it would be nice if it was part of the ModelRenderer so I don't have to manage two different ModelRenderers for my project.
Additional context
No response