Hey there, i’ve been trying to get an animated explosion texture to work right.
But my problem is that the texture just keeps repeating the animation. Is there any way to make this work completly right?
Thanks.
-Socker
Hey there, i’ve been trying to get an animated explosion texture to work right.
But my problem is that the texture just keeps repeating the animation. Is there any way to make this work completly right?
Thanks.
-Socker
I found that animated textures dont really work for explosions. A few issues, if there is more than 1 object with that animated texture then the texture will be the same on all of the objects. Also they dont start from frame 1 but instead continue from the last frame it was on.
The work around I use is to create a bunch of planes where each plane is UV mapped to 1 frame of the animated texture, then add logic to spawn the plane with the next texture. So the first plane would be spawned which would then spawn the second plane which would spawn the 3rd… and so on.
I used this method a long time ago, but it takes a long time to finally finish it.
So, another thing the BGE needs is this…
If you are comfortable with Python you can move the UV coordinates of an object, and thereby animate the texture as you please. The built in animated textures, however, do not give you a very great level of control.
If you aren’t comfortable with Python I really recommend you take some time to learn it, there’s only so much you can do in the game engine without scripting, and many of the things you can do with logic bricks are much simpler and less messy when done via scripting.
I know how to use phyton, but only a little. I’m still learning about it, and basically, all i have is an idea of how it works.
You can load images, one for each frame, or you can use a ‘UV Scroll’ script, and have a vertical or horizontal stripe of frames.
One thing I do is have explosion animations that never fade out (as in a continual burst) and then use object colour (animation curves) to do the fading. This means that it will fade out correctly, each explosion is different etc.
The UV animation method isn’t recommended for ‘duplicate’ objects like explosions or sprites of characters, as it has the same problem that animated textures have: they all share the same mesh, and so will share the individual frames of animation. Either spawn the frames like Excalaberr does, or replace the explosion plane’s mesh with the frames of the animation in sequence to form the animation. My Sprites Python module can do this quickly and easily, but you have to know Python. On the other hand, I believe it includes an example, so it might be worth checking out for you.