I’m making idle defense game

Share how to create a projectile with a playmaker

1.Making player FSM

Make Shoot Button

Attack Button FSM Image

Specify the int variable for each projectile type

Put the generation point in to generate the Steelball projectile. use Create Object.

Particle play for launch effect

It also adds sound effects.

Put a different effect on the second bullet

Place the particles in consideration of the direction.

2. Making Projectile

If it runs automatically at the start of the game, it looks like an error, so turn off the play on awake

2.1 Create Empty

2.2 Add Sphere (I can change this part to make a high-performance projectile.)

3. Make Projectile FSM

Random events have different representations of general and critical attacks

I made the initial critical probability 10%.(Since it is a global variable, can increase the probability by upgrading it.)

Two trigger events were created to allow the projectile to be removed by hitting a wall that was made far away if it did not hit enemy.

Adjust the bullet speed through the translate.

I calculated the enemy’s hp by sending an event to the FSM I made to the enemy.

Destroy itself after hit.

Similar Posts