Respawn Functionaltiy
Respawn Functionality
Author: Ashtyn Roman
Posted: 11/21/24
This week one of the tasks I worked on was creating the logic for the player to respawn after being kills, so long as the base had not been destroyed. The first way I attempted this was to destroy the player upon death and then spawn in a new player. This caused issues with connecting the player to the game state and player controller. It also would remove the players inventory, causing them to lose any materials, defenses, or traps they had. This would cause frustration as the player would but put at a huge disadvantage on respawn.
The next method I used, was to simply disable the player temporarily, and make him reappear at the respawn point. This would solve the inventory issue, but also came with its own challenges. First, the player controller was causing the game to crash when I tried to disable it. I found the issue was that there was another player controller initialized in the file that was different than the original controller. Once I deleted the second controller, I was able to disable and then enable the player controller without any issues. I then had to reset some death values in other files in order to enable the player to have full functionality.
As far as being able to play the game, the respawn function was working. The last issue that needed to be fixed is that upon respawning, the player stayed in the death animation state. The reload and hit animations still worked when they're supposed to. I have attempted different ways in code to try to reset the animations, from telling the animator to stop playing the animation to deleting the animator and resetting it. At that point, I figured the fix had to be done in the blueprint version of the animation class. We were able to get it fixed by adding in another transition to the animation blueprint so that the player would go from death back to his normal walking state when respawned.
Get Dustborn: Code of Survival
Dustborn: Code of Survival
Status | In development |
Author | PixelPioneers2411 |
Genre | Survival |
Tags | Sci-fi, Third-Person Shooter |
More posts
- Visual Updates for PlayerHUD24 days ago
- Issue with setting up EQS to have enemy move to the control unit24 days ago
- Inventory System Issues30 days ago
- In The Mind of UI Functionality30 days ago
- Issue with the enemy shooting the damageable wall31 days ago
- The Mistakes I Made With UI37 days ago
- Problem with Source Control and Projectile Collision.38 days ago
- Code of Survival's Description40 days ago
Leave a comment
Log in with itch.io to leave a comment.