How to make a MILLION sprites

Godot Version

4.3

Question

ok, not actually a million but how do i create a bunch of sprites to make a sprite trail without making sprite nodes. is there a way to just draw sprites in a bunch of positions every frame? or should i just bite the bullet and create a bunch of sprite nodes.

By sprite trail, do you mean when you have a sprite that’s moving you want to create a sort of trail of ghost images behind it?

You can use MultiMeshInstance2D to create a ton of sprites, but I don’t know how easily you can manipulate the properties of an individual sprite in the mesh: https://www.youtube.com/watch?v=mscJW51dotE

You can also look into using particle systems for a trail effect

Regular sprite nodes will work and give you more control over the properties of the individual sprites, if you only need a handful of sprites to get the effect you want this is what I would do

1 Like

I am so lost.
i would have said that you duplicate the sprite as a child for every _process_frame() but include a tween wait that automatically queue_free it after a period of time.
But your precise question is how to make a million sprites without making sprite nodes. So you want to create images that are not tied to any sprite node? My brain hurts.

basically in mario maker when mario leaves a sprite trail in edit mode to help the player design a course.

Creating a trail doesn’t sound like it would need a lot of sprites. I’d just use Sprite2Ds and move to more complex stuff only if it’s not performant enough.

Sprites are generally cheap to render.

Also, MultiMeshInstance2D isn’t the only alternative to nodes. You can also use _draw functions or use RenderingServer directly. With multimeshes you’d have to write a custom shader and handle the custom instance data; drawing textures from the CPU you can just modulate them: CanvasItem — Godot Engine (stable) documentation in English

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.