Previous:
[UE4] Making a fighter from scratch (middle: aircraft control logic)_Zhichao_97's Blog-CSDN Blog
Effect
step
1. Create a new Niagara launcher
Choose new launcher
Choose an empty template
Name it "ThrusterEmitter"
2. Open "ThrusterEmitter", select "Emitter Properties", check local space
Select "InitializeParticle", lifetime is set to 1, SpriteSizeMode is set to Uniform, UniformSprite is set to 8.5
Click the emitter update button to add a "SpawnRate"
"SpawnRate" is set to 50
Uncheck surround mode
Click the particle update button and add a "PointAttractionForce"
Click to fix the problem
Set AttractionStrength to 30, AttractionRadius to 500, and AttractionPosition to (-500,0,0)
Click the particle update button to add the Scale Sprite Size
Add a Vector 2DFrom Float
Add another Multiply Float
Add another one minus float
Enter the following settings:
3. Create the Niagara system
Name it "ThrusterSystem"
4. Turn on "ThrusterSystem", we want the position of the attraction point to change with the thrust
set to read from the new parameter
5. Open the aircraft's static mesh and create two new sockets in the socket manager
6. After creating the slot, open "BP_Jet" and add the following nodes
promoted to variable
Name it "LeftThrusterFXS"
Similarly, add a "RightThrusterFXS" variable
At this point, run the game and find that the particles have been generated at the specified slot position
7. Add a private function in "BP_Jet" and name it "UpdateThrusters"
Add the following nodes to this function
Among them, the value of "In Variable Name" (User.Attractor Position) is consistent with the value of AttractorPosition in "ThrusterSystem"
Using the function "UpdateThrusters" in the event graph
Running the game at this time, you can see that the length of the jet flame particles of the aircraft will change with the propulsion speed.
Next, start to make the color of the particles.
8. Open "ThrusterSystem", add a color module
Select Color from Curve
Click the curve button
Edit the color curve in the life of the particle roughly as follows
The running effect is as shown at the beginning of the article.