Bullet Penetration and Projectile Physics


page 1 2 3 4

22

22_1

Create a function called VaryTrajectory. Make sure it changes the velocity of a FirstPersonProjectile reference. Sometimes it will vary the trajectory of the spawned projectile, and sometimes it will take a reference to self.

23

Insert the VaryTrajectory function into the event graph after a new projectile is spawned, and also if the original projectile bounces rather than penetrates.

You should now be able to test that the VaryTrajectory function works correctly.

24

24_1

Add a Curve asset to the project, of type curvefloat. Copy the data points pictured - near enough is good enough. This curvefloat is a graph of Drag Coefficient vs Velocity(m/s). Velocity is on the horizontal axis.

25

25_1

In the FirstPersonProjectile tick event, add the effects of drag after the existing nodes.

For an explanation of the drag equation, see the youtube video.

You should be able to test the effects of drag now.

Finish

Congratulations! You have finished the tutorial!

Did you save some valuable time? Consider donating:

page 1 2 3 4