Any questions or comments on this lecture?
So… My question is: why do you still use the getter methods instead of actual getters and setters?
Yeah, for some reason my Player character starts to vibrate when engaged/hit by the enemy! It’s really weird. He just bobs up and down and shakes/vibrates until I start hitting them back. Any idea what could be causing it?
For the Unarmed Weapon. Can I use the Weapon Prefab as an Empty GameObject and for the Override Controller, I create the Override Controller for Unarmed, too. Is it ok to do so? The result is fine anyway, does not have any difference.
Yes, in fact, later in the course, we’ll be adding some audio to an empty game object for sound effects when punching with the Unarmed WeaponConfig.
Sorry for necromancing the post but I’m coming in late… just a bit.
Why using methods for getting WeaponRange and Damage in SO instead of a Property?
You can use a property if you wish. In terms of execution, there’s little difference, as a property will simply create a getter/(optional setter) method.
After following this lecture my enemies stopped animating. I could not figure out why. But implementing an unarmed empty prefab and override controller (as Tokado did) fixed the problem for me. For now…
Somehow my enemies stay dead. Since the saving lecture. I did the first saving lecture and skipped the second. I feel like I missed something?
If you’re meaning that when I save, an enemy that was dead when I saved is still dead when I load, then good, things are working as intended.
If you’re meaning that I save, thrust my sword of evil intent into the heart of my enemy, Load and the enemy just lies there dead anyways, this is a known issue, and one of many issues when using L)oad instead of re-issuing the scene.
The problem is that the SavingSystem assumes a default state when it Restores, but the Animator already has the character in a dead state, and no way to get to the Locomotion state from the dead state.
The cause is that we’re not truly reloading the scene with L)oad, instead, we’re working with what’s already there. In the SavingWrapper, go into the Update() method and change the instruction to Load() to
StartCoroutine(LoadLastScene());
After the lecture I did a test run and chased the guards in my scene. Unfortunally for them I was to strong. They did do some damage thnx to homing arrows haha. But then I saved the scene. After saving I can’t get them to wake up again. I have to delete them because they keep playing sleeping beauty. And my character is also very tired of fighting those guards. His health is 35 now. And If I try to put the health to 200 during runtime it doesn’t work. It says 200 but for real it’s still 35.
I think the problem is that my console gives a filepath that doesn’t exist. I Can’t find the .sav file on my mac. I was thinking maybe to delete the file and check if it still works.
Take a peek at the SavingWrapper/SavingSystem in the Course repo, and look for the code with the Delete() methods (I’m not at my coding computer, and can’t point you to where Sam talks about it). You should be able to delete the save file just by pressing that key (you may need to copy that code and put it in your SavingWrapper/SavingSystem.
The guards not getting up with a L)oad is due to not starting in a pristine state (a known issue).
In SavingWrapper.Update() replace the Load() call with
StartCoroutine(LoadLastScene());
Now, before I moved the damage and range over to the SwordSO
instance I had some customized values in play. Since the information sits now on the SO I can’t have an enemy being stronger by himself, so it seems the only option is instead have a normal strength enemy and give him a better weapon…
I guess sooner or later we will have some option to provide the enemies themselves with some strength so they can have the same weapon but still do (a bit) more damage…