Hello, thank you for getting in touch and for your support!
Although we have no sample that contains the functionality that you've described, we've looked into this specific situation and it seems that, if you need to receive multiple impacts, instead of having the single property 'Hit Position' you'll need to have an array of positions.
This can be done by using the
Global Array Node, and please note that you will need to specify a maximum size for the array as a requirement.
It would then be a matter of adapting the shader itself to take all these positions into account, as it's not prepared to do so. We would also suggest turning the 'Hit Time' property also into an array so each collision can have its separate hit decay time, for additional flexibility.
Regarding the Global Array node, you would have to create a node for each of its indexes.
The first node you create will need to have its Mode set to Object by default, its length configured to the size that you what and its Type to Vector4. You may also maintain its index with 0.
For all the other Global Array nodes, setting their Mode to Reference which will make a Reference drop-down appear which will let you choose your first created array. Don't forget you'll need to set the correct index for each of these nodes so all array elements are used.
You may want to also explore our
Shader Function feature, which lets you create a sub-graph and save it as a node which can be reused several times over your shaders.
Concerning the C# script, you will then have to adapt it to send arrays to the material. This can be done via the
SetVectorArray method.
We suggest pre-allocating an array with the correct fixed size, and updating with the collision information / sending it to the material over the OnCollisionEnter callback.
We hope that this helps!