Hi all, if your health bar is not updating whenever your player picks up a health potion or regenerates, we've included a fix on our Blog to cover it. You can view the fix here - blog.terresquall.com/2024/02/creating-a-rogue-like-vampire-survivors-part-17/#fixing-the-health-bar-not-updating-after-healing
I still have an issue with the enemies, they push me and and I'ld like to stop them. I use their speed on trigger enter, stay and exit but I sill have this issue. Thank you for all
Did you change your tutorials back to normal or are you still changing your whole style to template based? I was following this tutorial for a while but had to stop because a lot wasn't working for me after a while.
Hi Grim, the tutorials are more similar in style to Parts 15 and 16, but this one delves deeper into the technicalities because it is specifically about a bugfix. Sorry to hear the new style isn't working for you. If you can find the time to screenshot or video your issues and post them on our forums, we will be more than happy to help you with it.
Hello, will I be able to do this fix if my code is still at part 9? If so, how would I go about that since I dont have that actualstats part? I noticed the problem shortly after implementing the magnet and I´d like to fix it earlier before going through the other videos
You should be able to follow about 80% of it. For the PlayerStats part, you can just tentatively call SetRadius() on the Awake() function. If you have any further questions, you can create a topic on our forums. It is easier for us to share code over there: blog.terresquall.com/community
@terresquall I tried to do that and it didn't work. Here's the code in PlayerStats PlayerCollector collector; void Awake() { //Define valor das variáveis currentHealth = characterData.MaxHealth; currentRecovery = characterData.Recovery; currentMoveSpeed = characterData.MoveSpeed; currentMight = characterData.Might; currentProjectileSpeed = characterData.ProjectileSpeed; currentMagnet = characterData.Magnet; collector = GetComponentInChildren(); collector.SetRadius(); }
Yup, this is scalable, and definitely works with 50 or 100 NPCs. At larger scales, we can make further optimisations to the pickup or enemy scripts to accommodate even more entities. I'm reworking the enemy scripts in Part 19.
i dont think collectable item should determine the behaviour of how it's moving, only the effect of being collected. On other side the collector should do the moving collectables behaviour (simply by tracking them in a list) as it's his main purpose. If you switch/refactor/whaterver the playerstats or collector - there should nothing changed in collectables, but in your solution it will cause a problem.
@@terresquall one of the SOLID princibles is single responsibility. Even if you dont want to go stricktly to all these principles, still dividing responsibility between scripts is good logic. In your solution: pickups not only provide collect function, but also they move themselves to the player. While collector just setup them to self-behave; if you change, for example: 1. default Collector script to CollectorViaTeleportation or ZigZagCollector or AntiCollector(move items from player for example) - you'll be forced to go into collectibles script to change inner logic also. 2. you change playerStats to other data container/system to represent player's data -> now you need to change collectibles' script to ask for other parameters in collect() function; Etc. The more natural to oop solution is: collectibles know nothing about collector or player(or his stats); They also dont move by themselves; collector know about collectibles and interact with them (move them to itself, collect them if they in close radius, or even maybe stop moving them if they fall out of radius); That's its' role by name;