I’m just getting started with PlayCanvas and have been reading and learning. I made a project to explore texture animations. I’d like to understand if it is possible to assign one material to two objects and animate that material differently on each object. In the project, I setup a script that accepts an array of material asset references, an array of entity references, an array of configuration data for texture map UV animations, and an array of configuration data for tint animations. My goal was to apply all sets of animation data (scrolling, spinning, and tint) to all the provided references with this added functionality: If you pass a material asset reference, all objects with that material are animated but if you pass an entity reference, only that entity will be animated even if the material is shared with other entities.
So far the script is doing everything except material instance animation, and I have to say I’m really pleased with the level of documentation provided for this engine. However, I am unsure if material instancing is supported and was hoping someone could point me in the right direction.
When animating material assets I am accessing [materialAsset].resource.[animationParameter] and this successfully updates all entities that have that material asset applied. When animating by entity reference I tried accessing [entity].render.material.[animationParameter] and [entity].render.meshInstances[0].material.[animationParameter] and these attempts also update all objects that have the material applied.