Mixed feelings about the state of my RPG Project right now. I love the level-up effect I made, and the hit effects from my arrows and pickups are pretty much how I want them. The player can now at least see their health/xp/level/enemy-hp, which really does help a lot, and the new Firebolt projectile and hit-effect look awesome.
However, there are some glaring problems that I didn’t really notice until actually playing it thru on the uploaded site. Most of them seem related to changing scenes or save/load.
- Because the game recalculates save-data and turns xp into levels whenever a scene is loaded, it shows a lot of annoying things every time you enter a scene: level-up and enemy-death animations, a typo I made where it increases the player’s health thru every portal. (I fixed this already)
- For an unknown reason, if you save with ‘S’, then kill an enemy, then load with ‘L’, it loads positions and most things correctly, but the enemy is still dead. (not the same as Lecture #138 where enemies came BACK to life on load),
- If you enter the scene from a portal, move around/attack/etc, then save with ‘S’, reloading with ‘L’ brings you back to that save point. However, if you reload the game, it reloads with health/dead-enemies/etc correct except that it resets the player’s transform to the portal instead of the ‘S’ save point.
- My biggest issue was trying to create a cool slashing effect on the sword weapon. I tried many ways to do this, and they were all awful.
- Apparently, Unity refuses to tell your weapon its world coordinates, so if you try to spawn a particle effect off of the weapon, it cannot find the location, and spawns it in relation to world 0,0,0. After a couple days of fruitless effort, I made a nasty hack that forced it to the right position, but getting the rotation correct was more than I could manage.
- After giving up, I tried simply adding a trail to the tip of the sword like we did at the back of the arrow, and put the effect into a
SerializedFieldin my new
Melee.cscomponent on the weaponPrefab. In
Start(), I can access the trail and set
swingTrail.emitting = true/falseand modify it any other way I could think of without any problems. However, it seems to lose the reference to the trail because it will set the value of some magical, non-existent trail instead of the actual trail… It will tell me it is setting those values, I can print their values to the console, but the trail doesn’t change from what it was at the end of
Start(). If I select the sword at runtime, the trail effect is still there, but it isn’t being changed by the code.
I am not sure which of these might be something addressed later and which will not, so I am continuing on with Section 12 for now. If anyone has any insight on any of these issues, I would love feedback. Otherwise, enjoy the Firebolts and LevelUp animations!