Friday, October 4, 2019

Water VFX brief: Week 1 Friday

Friday's work consisted on making sure the particle effect worked properly within the scene.

Particle effect:

For the particle effect, I added colour over life to make the ripple fade out and size over life to increase the size over time. The Lock Axis was so that the particle effect wouldn't follow the camera view and would instead lay flay on the surface of the water. I set the initial size to 100 and the lifetime to 5.0, but these may be changed later when placing items in the water feature.
Blueprint:
For the blueprint, I scrapped what the ripple guide wanted and implemented my own. I wanted the particle effect to spawn once the actor was in the water and to end when they left it, so I plugged an Event ActorBeginOverlap and Event ActorEndOverlap into a Timeline node. I then tried to plug this straight into the Spawn Emitter at Location node, which used the GetActorLocation node which in turn had to be plugged into Get Player Character. This came up with an issue however, as it would retrieve the character location only once as they hit the water, but would only spawn the particle in that location, not following the character's movements at all. This would have been fine, but I wanted more dynamic water! I wanted it to react to where things were, or had been moved to.

This was where I then tried just using the Event Tick node with the Delay node, as seen in the guide I used yesterday. This was just as bad though, as it spawned the particle effect even out of the water. It was then that I discovered the add call to parent function while clicking on things just for the sake of the off chance of finding something useful. This made it so that I could plug the timeline node into the Tick node, but I knew it would be expensive and pointless to have it generate every tick of the engine, so I changed the delta seconds to 3.0, and the delay to another 3.0, using it like a refresh button on the particle spawn node. Luckily for me, the Timeline node had a play from start section that I could plug the Spawn Emitter at Location into. This meant that upon the actor touching the water, the Tick node would refresh the particle effect spawn event every 3 seconds with a 3 second delay, which in turn meant that a new location would be received every 3/6 seconds- following the position of the actor!

After this success however, I discovered that the particle effect was spawning at the waist of the player character and not on the water surface. I wasn't sure how to tackle this problem so I had to ask a lecturer to help. Through this however, I was taught that I could split the structure pin of the location node, which was originally plugged into only the GetActorLocation node. I could now plug the Location X and Location Y into the position of the actor, while the actual height (Location Z) could be plugged into the location of the water surface itself. The ripple could finally be generated on the surface of the water depending on where the character (or lily pads in the future) were placed!


When I was messing with the blueprint, I realised that I needed the emitter to have 1 loop, emitting once and then stopping. This was to prevent the ripple effect from being spawned constantly in one location regardless of where the actor was, based on where the actor had been previously. I needed these excess ripples to be killed immediately after ending.
End Result:

No comments:

Post a Comment