๐งต#Hi Folks, am i allowed to ask a Needle
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
Hi <@614880833924497419> plz don't ping ๐ i just turned off the computer but try to look into it later or tomorrow
sry, wont happen again, thanks for looking into it
Timeline can change whole material references? I dont think we have this implemented. Are those totally different shaders?
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)
You can use the sprite renderer. There is a sample using the animator but should work with timeline the same way
That being said please upload your scene as a bug repo (menu item Needle Engine/report a bug)
In case i need a repo ๐
will upload and try with sprite renderer, we desperately need this functionality. thanks for everything
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
Ah just misunderstood at first, you're trying to change the textures via animation
yes, so sprite renderer wont work?
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 ๐
Oh just to throw it out there as well: custom timeline tracks should also work. There is some example code here for scrubbing a video (its what our needle-tools website uses) https://github.com/needle-tools/needle-engine-modules/tree/main/package/TimelineVideo
Or changing html classes based on timeline time: https://github.com/needle-tools/needle-engine-modules/tree/main/package/TimelineHtml
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
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.
have a chill weekend <:CE_DoggoBlancket:750133157734514708>