Forum begins after the advertisement:
[Part 15] How do I change the description and name when I level up?
Home › Forums › Video Game Tutorial Series › Creating a Rogue-like Shoot-em Up in Unity › [Part 15] How do I change the description and name when I level up?
- This topic has 3 replies, 3 voices, and was last updated 1 hour, 7 minutes ago by
Alp Apustaja.
-
AuthorPosts
-
June 19, 2025 at 12:29 am #18324::
Please tell me how I can change the text in this window that appears when the level increases. I used to just change the Objects – Weapons – Knife Weapon in the Scriptable inspector (as an example), but after part 15 it doesn’t work (
https://imgfoto.host/i/hcb7zR – This is now, nothing is changing
https://imgfoto.host/i/hcnx5l – It used to be, everything was changing
June 19, 2025 at 12:35 am #18325::It sounds like you’re facing an issue with updating the text in your game when the level increases. Since you mentioned that it used to work but stopped after a specific part, here are some troubleshooting steps you can take:
-
Check Scriptable Object References: Ensure that your Scriptable Objects are still properly referenced in your code. If the reference is missing or broken, changes made in the inspector won’t affect the game.
-
Inspect Level Up Logic: Review the part of your code that handles the level-up event. Make sure that it is still correctly accessing the text properties of your Scriptable Objects. If there have been any changes to how levels or weapons are managed, that could affect this.
-
Debugging: Add debug logs in your level-up function to print out the text values being assigned. This can help you identify if the correct values are being fetched from the Scriptable Objects.
Debug.Log("Current Weapon Name: " + weaponName);
-
Prefab/Scriptable Object Updates: If you are using prefabs or instances of Scriptable Objects, ensure that you’re updating the correct instance. Sometimes changes made to a prefab or Scriptable Object won’t reflect if you’re using an instance that hasn’t been updated.
-
Check for Overriding Values: Make sure that there are no other scripts or settings that might be overriding the values you are trying to change. Look for any other components that might be modifying the same text field after you set it.
-
Review Recent Changes: Since you mentioned this issue started after part 15, review any changes made in that part. There could be a new piece of code that affects how the level-up event is processed.
-
Unity Console Errors: Check the Unity console for any errors or warnings that might indicate what’s going wrong. Addressing these can often resolve unexpected behavior.
If you can provide more specific code snippets or details about how your level-up logic is structured, I can give you more targeted advice!
June 19, 2025 at 10:37 am #18327June 19, 2025 at 6:38 pm #18329::A little later, but can you tell me where to change the description of the weapon? Is that where I changed it at the inspector or elsewhere?
June 19, 2025 at 6:41 pm #18330::Based on the reference information provided, you should modify the description in this specific line of code:
upgradeOption.upgradeDescriptionDisplay.text = chosenWeaponUpgrade.weaponData.NextLevelPrefab.GetComponent().weaponData.Description;
This suggests that the description is now being pulled dynamically from the WeaponController component, rather than just from the Scriptable Object inspector as you did previously.
June 19, 2025 at 6:48 pm #18331::I downloaded your project from part 19 and am trying to change the description of the weapon. I didn’t change the scripts or anything.
June 19, 2025 at 6:50 pm #18332::Could you clarify exactly where you’re trying to change the weapon description? In the Scriptable Object inspector, or somewhere else in the project?
-
-
AuthorPosts
- You must be logged in to reply to this topic.
Advertisement below: