# How to keep particles moving around inside an invisible box

I'm trying to create a kind of mystical shadow thing, made from black particles of varying size. Essentially, I'm using a shape (I've tried it with several things: A cube, a custom shape I made, a cylinder, a sphere, etc) as the outline, and trying to have a bunch of particles surrounding the edge of the shape, or else filling in the inside without going out, or much out.

I can get it to work for a still image by just having the start and end frames set to 1, but for an animation, how would I get them to constantly move around (not just bounce off the walls like when I tried having an invisible collision shape) inside the volume of the object?

For a solution less based on "particles" that might be more manageable with complex moving meshes, you could try a volumetric shader in which the density is animated using some sort of noise texture.

The general node setup is as follows:

In this case, just as an example, I animated the texture's location (via the Mapping node) and the Scale of a noise texture. Both were done with keyframes, you could play around with these and other parameters to find something that looks pleasing to your eye.

Failing that, if you want something more "particle-y" but with sharper edges, another concept you might try to play with is an animated surface texture using shapes such as small spots.

Again, there's quite a bit you could do to tweak this concept.

• Both of these methods work awesomely, thanks! Feb 15, 2018 at 10:08
• happy to help, glad you've got it working! Feb 15, 2018 at 19:06

I think "brownian motion" is probably what you're looking for.

The setup for this example includes two cubes: one as the emitter, and one (slightly larger) as a collision object, so that the particles don't wander too far. These particles are emitted from the volume and I gave them a very slight starting velocity from the normals, but most of the motion comes from the Brownian force under "Physics". It is important to give the particles a small amount of drag and/or damp, otherwise the Brownian motion will keep adding up and the particles will increase in velocity over time.

• This works with a shape that doesn't move, but how would I do this with a character (an armature, or rig, whatever)? Feb 15, 2018 at 3:56
• If you are not wedded to "particles" perhaps an animated volumetric shader would be a better bet for this type of thing. I can show you an example in a bit. Feb 15, 2018 at 4:22