“This is the 24th day of my participation in the Gwen Challenge in November. Check out the details: The Last Gwen Challenge in 2021.”

👉 About the author

As we all know, life is a long process of constantly overcoming difficulties and reflecting on progress. In this process, there will be a lot of questions and thoughts about life, so I decided to share my thoughts, experiences and stories to find resonance!!

Focus on Android/Unity and various game development tips, as well as various resource sharing (websites, tools, materials, source code, games, etc.)

Welcome to pay attention to the public account [Mr. Empty name] for more resources and communication!

👉 premise

Let’s pick up where we left off, where we imported the DOTween plugin, and now add the DOTween Path script to the particle object.

Let’s look at the renderings

👉 Practice

At the bottom of the DOTween Path script, Waypoints are Waypoints. Of course, you can also create and delete Waypoints using shortcuts, but these are specific coordinate points that are easier to write.

Let’s start by creating a simple straight line ecg: add a coordinate point

Run it and have a look:

Not bad. Add a little bit of a twist and try again.

Operation effect:

It looks like something, but it’s not perfect, so let’s recall: what should an ELECTROcardiogram consist of?

It should be led by a dot and followed by a meteor, so let’s perfect it:

One point material: EKG _ trace and one trailing material: EKG _ point are assigned to the material and trailing material options in the particle renderer respectively.

Look at the results

The tail is better than it used to be, but the finding is still not good: the folds don’t seem to fit the track as expected.

So let’s change the vertex distance of particle trailing module to 0 and see again.

The finding did come close to the real track, but it was still wrong: it clearly felt like the bent particles overlapped too much.

Yes, the reason for this is that we changed the minimum vertex distance of the particle trailing module to 0, but the effect is not to follow the established track.

After discussing and thinking with my friends, the reason for this problem is ****Shader

There are two solutions:

  1. Remove the blurred translucent effect, the solid line. Change Shader to Unlit/Color. If the trailing lines look thick, reduce the trailing width.Well, it looks good

  2. Keep the original content, only modify the line width, to achieve enough thin, and then deceive the eye, not perfect.

  3. Some big guy saw the key at a glance, the actual effect depends on Shader, built-in dissatisfaction, start to write a Shader on the line, but small empty lack of knowledge in this respect, temporarily no plan, welcome big guys message.

Conclusion:

The ELECTROcardiogram is implemented using a particle movement with a trailing, and the movement is implemented using DOTween. It is easy to operate and the electrocardiogram can be realized by particles without consuming performance.

Well, the whole process is as above, to provide an idea for electrocardiogram, but the specific business is certainly more complex, such as electrocardiogram data is different how to update at any time, such as electrocardiogram and heart pulse do synchronization, more operations need you big guys more practice.

👉 other

📢 author: Kom and Kom in Kom

📢 reprint instructions – be sure to specify the source: Zhim Granular’s personal home page – column – Nuggets (juejin. Cn)

📢 welcome to like 👍 collect 🌟 message 📝