Skip to content
VladGG edited this page Aug 1, 2022 · 3 revisions

How to make a falling sand quad

Create a square sprite, give it a "UniversalRenderPipeline/Lit" material, add the "Particle_Logic" script, then add values to the variables. Done!


How to place a simulated particle

In script call the "CreateNewParticle(byte type, int atIndex)" function. This is an example of how to create a sand particle at a Vector2Int particle pos:

Vactor2Int particlePos = new vector2Int(25, 50);
CreateParticle(1, PositionToIndex(particlePos.x, particlePos.y));

You can also have a look at the source code to see all of the functions and modify them.

Clone this wiki locally