UE4: sprite sheet, flipbook troubles. Oil splash

I am using UE4 and I want to create the effect of oil being splashed onto the ground.

My approach so far has been to make a sprite sheet put it in a material decal and place it on the floor. Then use a matinee scalar parameter to make the sprite visible and another to swap in the last frame so it doesn’t keep looping. I then add a simple onHit play matinee to the level Blueprint. I think its a pretty sloppy approach, my knowledge is limited.

The problems I have is when the sprite becomes visible it’s not always starting on the first frame. And the second problem which is related to the first, is the hold frame that I swap in to stop it looping doesn’t always happen at the end of the animation. The particles I will add once I get this sprite sheet problem sorted.

Can anyone suggest a better way of creating this effect. Maybe it should all be done in a Blueprint rather than Matinee?

I haven’t used UE for a long time but as far as I know you can just use Cascade for everything.

Play the SubUV using a curve, so that it stop playing at the end of your animation. If you wish the last frame to last forever you just create two particle systems. One with lifetime equal to the length of your SubUV animation and you delete it. Then spawn a particle exactly the same time the previous died with set to display only the last frame. You can force this by a curve too. Set the lifetime to 99999 and you are good to go.

This might flicker in some cases and you may be forced to experiment with spawn time but it should work. That’s basically the same thing you where trying to achieve via blueprints.

Hope this helps!

I have a couple questions. Are you using this in a sequence or is this part of a dynamic weapon or object or is this a sample you want to have for you? I’d approach it differently depending on how much control you have spawning the effect. Gaxx has the most of the answer there, but I’d be curious as to how you’re using the effect in the game state and go from there.

I am building an FX demo reel. In this case I am using the firstPerson template. The projectile hits a car the car explodes. On the ground I see a oil splash appear as a Decal. For the oil splash I sources some stock footage and turned it into a sprite sheet. Immediately after the oil hits the ground it ignites. btw, I have done all the particle work found in the explosion, I am just adding to the explosion effect with the oil splash.

I maybe approaching this the wrong way, so please let me know if I you think I am.

Sounds like Gaxx suggests I should make the splash as a particle emitter! I am not sure how this would look since I want it to sit on the ground like a material/decal.

Hello! If your ground isn’t completely flat you’ll need to use a decal. If you have a flat surface you could use an oriented sprite to achieve the same look with what Gaxx is describing and much easier than what it sounds like you’re doing. It sounds like you’ve got a lot of control over the effect and how you want to show it, so doing a hide/show makes sense for the decal and the adjoining effects. Use that to your advantage and treat it as if you’re doing a cinematic. Is there anything you can show?

Here is my work in progress.
https://www.youtube.com/watch?v=dMMzp9Qv_Lo

The problem I am having is with the oil splash out side the car and on the ground. I am using matinee to play it, and then using the Level BluePrint to call the matinee. Because the spalsh is derived from a sprite sheet I dont know how to get it to start exactly at the point I want because it is looping from the beginging of game it sees the begining of game as its start point.

Hello, Looks like you’re making some good progress. I’ve had this issue before, and I’m trying to remember how to fix it… I remember it had to do with resetting the time when the object is activated. Is the object enabled from the start? You might need to have the decal disabled, then enable it when its becoming active.

Alternately, you could use an erosion texture instead of using a flip book. Author the texture so its spreading texturally instead of as separate flips. It might give you the spread and smoothness you’re looking for. Can I see the level blueprint?

1 Like

This is a simple way to have an anim that plays once in a material: You’ll need to trigger the event from matinee so you can do the material setup in blueprint.

Just set the StartTime scalar parameter with the GameTimeInSeconds from blueprints.

Anim Length will control how long you want it to take. So set it to 1 (or remove the divide all together) if you want it to just take one second, but if you want it to go faster or slower just set it to the number of seconds you want.

Also with this you don’t need the still frame at the end, unless you actually want it to be different from the last frame of the sprite sheet.

1 Like

Doing it completely with Matinee is also super possible. Just a slight change of the way you think about it.

The first thing you do is need to replace your Time node with a scalar parameter value that the matinee updates directly.

Then you actually key the ‘time’ value in the matinee itself in a Float UMaterial Parameter Value track where you set a key with a value of 0, for when you want to start, and a key with a value of 1 for when it should be done. (Remember to select the keys and change them to linear unless you want an ease in and ease out.)

Material Parameter Tracks are a bit unintuitive in my opinion, but they work super well for these when they aren’t being used everywhere, and have the benefit of taking care of your dynamic materials for you. (Matinee’s have a bunch of other benefits too, like handling replication very well in multiplayer environments.) They aren’t the cheapest thing, but if you need to update something every frame they are probably the best option you have without writing your own management systems in C++.

And most importantly the best reason to use Matinee for something like this is that once it is setup right, it is scrubbable in the editor. So the material animation you can scrubb back and forth through.

Here are some screenshots of the setup:

1 Like

LOVE this thread! :heart_eyes: