๐Ÿงต#Hi Folks, am i allowed to ask a Needle

aeleks

iโ€™m trying to change a material reference at runtime via the timeline and while it works in Unity, it doesnt work in Needle. Iโ€™ve tried different shaders and approches (URP, UnityGLTF, Shadergraph) but nothing worked so far. <:Rodentge:1385756070177144933>

Any suggestions or workflows to achieve this?

Kind Regards

marwi123
marcel ๐ŸŒต โ†—

Hi <@614880833924497419> plz don't ping ๐Ÿ™‚ i just turned off the computer but try to look into it later or tomorrow

marwi123
marcel ๐ŸŒต โ†—

Timeline can change whole material references? I dont think we have this implemented. Are those totally different shaders?

aeleks

yes, because i havent found a way to change textures of/inside materials via the timeline so far (im relatively new to unity, unreal dev by trait)

marwi123
marcel ๐ŸŒต โ†—

You can use the sprite renderer. There is a sample using the animator but should work with timeline the same way

marwi123
marcel ๐ŸŒต โ†—

That being said please upload your scene as a bug repo (menu item Needle Engine/report a bug)

aeleks

will upload and try with sprite renderer, we desperately need this functionality. thanks for everything

aeleks

will hopefully report a very heavy bug regarding timeline/animation changing base colors on materials soon too. its super intermittend and sometime randomly affects completely unrelated assets too, very hard to reproduce but i'll try to figure something out

marwi123
marcel ๐ŸŒต โ†—

Spriterenderer is what you want but textures need to be in one atlas.

Another option would be a texture array in a custom script and you simply animate an index property via the timeline and set the texture from there. Should just be a few lines of code.

Third option that comes to mind would perhaps be a video but sounds less ideal + you loose texture compression (well but gain video streaming although quality might not be the as good as some crisp textures).

Not sure what you need or have exactly so just through some ideas at you ๐Ÿ˜‰

aeleks

the 2D-Guy in the Video is basically the Teacher/Narrator of our Project and i want/need to change his poses/expressions (different textures) based on the things he is saying/explaining. Timeline is/would be the best solution for this, since i can move and reorder Keyframes if the parallel playing voiceover audio changes while we are reworking the voiceover.

While this would work with a simple texture change as you've mentioned above (will take a look at these suggestions over the weekend), changing whole Materials / mat. refs. on meshes via the timeline would be a very useful functionality too ... we especially could use this right now since our animated base color changes (we are explaining how a electric motor works and need to be able to re-color wires and elements of the motor dynamically to explain how the magnetic fields affect stuff) are completely broken (the intermittent bug i've mentioned above) and we need to show/present what we are working on next week <:furbyPanik:954277434587512832>

I've used the report bug feature to send you the project with the not working material ref. changes

aeleks

If you want, i can show you this super weird base color keyframing issue via a Discord Videocall next week ... its very hard to explain in words and reproducing it outside our project will be tricky too.