- Home /
Making Foot Dust with meshes like Mario 3D World
Hi, im making a 2.5D platformer (with poor coding knowledge), i really like those dust meshes from this game.
I've made an animated cloud mesh that goes from a tiny smoke and scale to a dust mesh, and then it slowly scale to almost 0. I would like to know how to instance/create those meshes when my character only run, meshes need to create and "die" in a place and not follow my character, I dont know if i need a particle system or just a script would made it. Thanks in advance!
Thanks guys, this was my first question in the forums, what a great community. Im a 3d modeler, and i know how to do some things in unity, but im starting. I read somewhere that those smoke effect were indeed meshes, im doubtful now, but thats a nice effect, my question was ai$$anonymous$$g to the instancing meshes answer, so thanks Owen and Fattie! I will try both techniques, instancing animated meshes and doing the proof method of the "sprite" particle effect, will try to post my results when i have it.
this would have to be one of the best questions ever posted on here. It's so polite that you bothered to make an EXACT video (animated gif? whatever it is!) showing precisely what you meant. The model question. I sure learned something from Owen. Cheers
I would love a Unity package of $$anonymous$$ario effects - I really like the look of theirs. Did you manage to create a similar looking effect? I would much love it if you could share it.
Answer by Owen-Reynolds · Oct 04, 2013 at 02:42 PM
That's just a regular particle effect. Nothing special about the one you're showing. Pretty much every game has the same thing. That's good, because Unity can make those with no trouble at all, with particleSystem.
That dust is a texture. Maybe it's UV-animated (which is a standard feature in both Unity particle systems,) but it might be just one texture, getting larger/smaller. The blast coming from his rear lower abdomen is "aimed," which is also standard in the Unity particleSystem.
Forget the "mesh" part. That's for spitting out solid objects. Technically everything is a mesh, but the particleSystem will handle it for you. You can think of it as simply showing copies of your picture.
Then the rest is what SS and perchak write about -- when do you turn it on/off.
Here's an explanation of how to instantiate stuff in unity, which I think is what you were asking. BUT what you are seeing, you simply do as Owen explained. Enjoy
All you need is a script! That's it.
Do you know how to put your animation work in a Prefab?
Simply then use the command Instantiate to make a new one.
var yourPrefab:GameObject; .. drag it in the editor, you know?
var newSmoke:GameObject = Instantiate( yourPrefab );
newSmoke.transform.parent = .. I suggest the floor or room;
newSmoke.transform.position = .. where you want it
newSmoke.name = "I made this in real time";
// always give them a name so it makes sense in your editor
it's that easy. Note that you will hear a thousand times, especially from me, "Never instantiate in a video game, use a pool" Long discussion: http://answers.unity3d.com/questions/321762/how-to-assign-variable-to-a-prefabs-child.html
But here as a learning exercise you should just Instantiate. No problem.
In terms of how to get rid of it when it is finished, just do this in a small script, and attach the small script to your prefab
Start()
{
Invoke( "getRidOf$$anonymous$$e", 3.5); // so, after 3.5 seconds for example
}
function getRidOf$$anonymous$$e()
{
DestroyImmediate(gameObject);
}
it's that simple! ENJOY!!
an outstanding point, to put it mildly, that this can and should be done just as particles -- the OP did not need to go build an animated object!
Answer by perchik · Oct 04, 2013 at 01:30 PM
Seems like it's not too hard... create a flag to tell if you're running or not. If you are running, every second (or half second, or whatever) spawn your smoke cloud at the back of the character. I don't think the smoke cloud even "follows" the player, it looks like there's actually just a bunch of clouds.
Answer by SilentSin · Oct 04, 2013 at 01:59 PM
The best way would be to look into animation events. Create an event every time a foot touches the ground in the run animation, maybe a different event for each foot. Then have that event call a function that instantiates your dust prefab.
A far more efficient way to do it would be to only have one particle system and instantiate a single particle or group of particles each time, but I doubt you care about the performance.
Answer by UltraGearGames · Jul 22, 2019 at 12:55 PM
How do you make the dust meshes themselves though? I cant seem to find anything on the topic anywhere.
Your answer
Follow this Question
Related Questions
FPS footsteps only work when jumping/hitting edges of a mesh 1 Answer
Cant see rock mesh in scene, but can see them in game. 1 Answer
Realtime Skin Mesh Decals 0 Answers
How/Where to learn about mesh operations? (help) 1 Answer
Non-Convex Mesh Collider triangle limit - is it more than 255? 0 Answers