Projectile Logic
The projectile logic is very simple, and is completely contained within the PlayerProjectile script. All that was required for this was collision registry logic. The projectile constantly checks for collisions, and when it does collide with something, it gathers information on what it hit to decide how to act. When a projectile collides with anything, I wanted it to stop moving and to "stick into" whatever it hit. This meant freezing the projectiles rotation and enabling isKinematic. If the target hit is part of the environment, the projectile disappears after a few seconds and the logic reaches completion. If the target hit is an enemy, then the projectile becomes a child of the enemy. This is so the projectile sticks into the enemy and moves with them. The projectile stays in this state until the enemy dies. I chose to do this in favour of giving enemies health bars, so that the player could have some gauge of how damaged an enemy is. After a collision is detected with an enemy and this all happens, damage is dealt to the enemies health equal to a float called playerDamage. This is to allow for scalability with potential upgrades in the future. If the enemy dies, all projectiles are deleted along with the enemy due to being children.
-Griffin
Get Sanguine Falls
Sanguine Falls
Atmospheric FPS with a Night/Day cycle for killing rounds of vampires in a coastal forest town.
Status | Prototype |
Authors | TDMProductions, Saje, Adequate guy |
Genre | Survival, Shooter |
Tags | Atmospheric, Creepy, daynightcycle, First-Person, Horror, roundbased, Singleplayer, Unity |
More posts
- Build 0.1.4 - Sensitivity Bar addedJan 15, 2024
- Matt Ep. 5 - Finishing touches, polish, details, fxJan 12, 2024
- Matt Ep. 2 - Blender/Pro builder Modelling, Environment, Main Menu + DotweenJan 12, 2024
- Matt Ep. 3 - Day/Night Cycle, Round Management, Game FlowJan 12, 2024
- Matt Ep. 4 - AudioManager, SFX, MusicJan 12, 2024
- PlayerController/HealthJan 11, 2024
- Shooting FunctionalityJan 11, 2024
- Matt Ep. 1 - Planning, Vision, MVPJan 06, 2024
- Pause MenuJan 03, 2024
Leave a comment
Log in with itch.io to leave a comment.