Forum begins after the advertisement:
[Part 18] Area start with +100%
Home › Forums › Video Game Tutorial Series › Creating a Rogue-like Shoot-em Up in Unity › [Part 18] Area start with +100%
- This topic has 8 replies, 2 voices, and was last updated 5 months ago by Terence.
-
AuthorPosts
-
July 10, 2024 at 8:08 pm #15238::
After following your Part 18 I’ve noticed that for me if both the character and the weapon have the value for Area set to 1, all my weapons will start with 100% increased (double the size). I’ve tried with 0 as the base for Area on both the weapons and the characters, either at the the same time, or separately. The other stats look to be working fine. I’ve looked at the Part 18 files and on your end seems to work with both set at 1.
July 10, 2024 at 10:28 pm #15239::What is your character’s area stat set to?
You also want to add the highlighted line here and see what result you get whenever a new weapon spawns:
public virtual float GetArea() { print("Current Area of " + name + ": " + (currentStats.area + owner.Stats.area)); return currentStats.area + owner.Stats.area; }
July 11, 2024 at 12:19 am #15240::If I leave the Area set to 1 on both the characters and the weapons, I get this:
If the character has the Area set to 0 and the weapon to 1:
I could provide the codes here, but if it’s easier for you I will provide the link to my project on github (Not sure if links are allowed, we’ll see): https://github.com/SilvianBratosin/FinalProject/tree/main/Assets/Scripts
Also, should Area affect the whip as well? Because it doesn’t look like it does for me. I named the Whip Slasher.
July 11, 2024 at 12:36 am #15241::The thing is it kinda “works” visually and mechanically if I set the value of Area in the character data to 0 (as in it’s the actual starting size), but the value in the pause screen is shown as negative %.
July 11, 2024 at 2:09 am #15243::For the area issue, my bad, it appears the article was wrong. It should be:
public virtual float GetArea() { return currentStats.area * owner.Stats.area; }
Once you change the operator from
+
to*
, the issue should go away, and you can set the player’s Area stat to 1.For the area not increasing, check whether the above changes fixes your issue. Otherwise:
- Check whether the spawned effect has a scale of above 1 when your area stat is increased. It might be that the scale is increased, but the particle effect is not set to scale.
- If the scale remains 1, check your Whip’s script has a portion that sets the spawned projectile’s scale.
Refer to the video to see how to get the whip effect to scale. There is a variable you need to set (sorry, I forget its name at this moment) for it to scale.
July 11, 2024 at 2:13 am #15244::I’ve also given you a Content Contributor on your profile here as thanks for finding this typo in our article.
July 11, 2024 at 2:23 am #15245::Thanks for the fix on the wrong operator used. And regarding the other issues, my bad. I’ve meant to say if the Area in character data and passives should affect the Garlic (Spike Aura in my game) as well, not the Whip. The other are scaling accordingly with the Area, but the Garlic area only scales with it’s own bonus through the level up, not the character/passives.
July 11, 2024 at 3:49 am #15246::Also, non-related, there is also a slight typo, although not crucial since the script is written as it should right underneath, on the section 6.a. on Part 19 article. You’ve crossed the wrong line ChangeState(GameState.Paused); instead of previousState = currentState; :
Again, not crucial, the whole script is good immediately after.
July 11, 2024 at 10:28 pm #15254 -
AuthorPosts
- You must be logged in to reply to this topic.
Advertisement below: