Killer objects
Let's add some dangerous objects for the player. The first one is an easier version of the KillZ volume. Create a new Blueprint extending an Actor and call it KillVolume
. Add a box collision on the Viewport and extend its onActorBeginOverlap
method with the KillPlayer
function we created earlier as single node. You can understand the advantages of the function libraries now:
Duplicate this Blueprint and call it RollingBall
. Change the collision box with a sphere and add a Sphere
mesh with enabled physic. Those dangerous balls will be thrown down a hill ready to kill the player. Don't forget to choose OverlapOnlyPawn from the Collision Presets dropdown, unless you want that you player is killed by unwanted collisions:
Duplicate this item and call it Bullet
. Make it smaller, remove the physic simulation, and add a Projectile component. Use the same settings we used in the previous chapters: Autoactivate, Initial Speed, max force of 2000, and 0 gravity. On the Event Graph, set...