Forum begins after the advertisement:
[Part4] The heart no respon and doesn’t increase
Home › Forums › Video Game Tutorial Series › Creating a Metroidvania in Unity › [Part4] The heart no respon and doesn’t increase
- This topic has 9 replies, 3 voices, and was last updated 3 weeks ago by
Terence.
-
AuthorPosts
-
March 7, 2025 at 2:37 pm #17418::
View post on imgur.com
The heart is stuck in the middle but I try to change the position so I edit in the prefab but the position not change at all, when I play the game and the Player got a attack with Enemy the heart is still full and not increase and the position in the middle, Sorry if my English not good cause English is not my first language.
void Start() { player = PlayerController.Instance; heartContainers = new GameObject[PlayerController.Instance.maxHealth]; heartFills = new Image[PlayerController.Instance.maxHealth]; PlayerController.Instance.onHealthChangedCallback += UpdateHeartsHUD; InstantiateHeartContainers(); //this is the error that Unity says. UpdateHeartsHUD(); } void InstantiateHeartContainers() { for(int i = 0; i < PlayerController.Instance.maxHealth; i++) { GameObject temp = Instantiate(heartContainerPrefab); temp.transform.SetParent(heartsParent, false); heartContainers[i] = temp; heartFills[i] = temp.transform.Find("HeartFill").GetComponent<Image>(); //and this is to. } }
March 7, 2025 at 2:46 pm #17419::It seems like you’re running into issues with instantiating your heart containers and accessing the
HeartFill
component in Unity. Let’s address the potential problems one by one.Error Understanding
-
Instantiation Error: The error you’re seeing when calling
InstantiateHeartContainers();
suggests that there might be an issue with theheartContainerPrefab
. Make sure that:- The prefab is assigned in the Inspector.
- The prefab exists in your project and is not null.
-
Finding HeartFill Component: The error at the line
heartFills[i] = temp.transform.Find("HeartFill").GetComponent();
suggests that the child object named “HeartFill” could not be found under the instantiated prefab. Make sure:- The prefab has a child object named “HeartFill”.
- The name is exactly “HeartFill” (case-sensitive).
- The
HeartFill
object has anImage
component attached to it.
Suggested Fixes
-
Check Heart Container Prefab: Ensure that
heartContainerPrefab
is assigned in the Unity Inspector. If it’s not, you’ll get a null reference error when trying to instantiate it. -
Check Hierarchy: Open your heart container prefab and verify that it has a child named “HeartFill”. If it’s named differently, update the string in the
Find
method to match the name exactly. -
Debugging: You can add some debug logs to help you identify where the problem is occurring:
void InstantiateHeartContainers() { for(int i = 0; i < PlayerController.Instance.maxHealth; i++) { GameObject temp = Instantiate(heartContainerPrefab); temp.transform.SetParent(heartsParent, false); heartContainers[i] = temp; // Debugging line Transform heartFillTransform = temp.transform.Find("HeartFill"); if (heartFillTransform == null) { Debug.LogError("HeartFill not found in " + temp.name); continue; // Skip to the next iteration if HeartFill is not found } heartFills[i] = heartFillTransform.GetComponent(); if (heartFills[i] == null) { Debug.LogError("Image component not found on HeartFill in " + temp.name); } } }
Position Issue
If the heart icons are not positioned correctly, ensure that the RectTransform settings of the prefab and the parent (
heartsParent
) are set correctly:- Check the anchor points and pivot settings.
- Ensure that the heart containers have the correct layout settings if they are part of a UI layout (like a Vertical Layout Group or Horizontal Layout Group).
Final Steps
After making these changes, run your game again and check the console for any debug messages. This should help you identify what might be going wrong. If you encounter further issues, feel free to share more details!
March 7, 2025 at 4:06 pm #17420::Hi Siti, a few things to check:
- If you have an Animator on your heart, disable the animator and see if it fixes the issue.
- Otherwise, I suspect your issue is that you are editing the position on your prefab. You should edit the GameObject in the scene instead.
Hope this clarifies!
March 8, 2025 at 9:35 am #17433March 8, 2025 at 9:41 am #17434::It sounds like you are working on a game where the player’s heart (or health) should decrease when they are attacked by an enemy, but it isn’t happening correctly. To help you troubleshoot this issue, I’ll need a bit more information about your code.
Here’s a general outline of what you might want to check:
-
Enemy Attack Logic: Ensure that the logic responsible for the enemy’s attack is correctly implemented. For example, confirm that the attack function is being called when the enemy interacts with the player.
-
Player Health Variable: Make sure you have a variable that keeps track of the player’s health (e.g.,
playerHealth
). -
Decrease Health Function: Implement a function that decreases the player’s health when an attack occurs. Here’s a basic example in pseudocode:
class Player: def __init__(self): self.health = 100 # Starting health def take_damage(self, amount): self.health -= amount if self.health < 0: self.health = 0 # Prevent negative health print(f"Player health: {self.health}") class Enemy: def attack(self, player): damage = 10 # Example damage value player.take_damage(damage) # Usage player = Player() enemy = Enemy() enemy.attack(player) # This should decrease the player's health
-
Event Triggering: Check if the attack event is getting triggered correctly. You might want to add print statements or logs to track whether the function is being called.
-
Game Loop: If you're using a game loop, ensure that the enemy's attack logic is being executed during the game’s update cycle.
-
Debugging Tools: Use debugging tools or print statements to track the values of the player’s health before and after an attack to see where things might be going wrong.
If you can provide a snippet of your code related to the enemy attack and player health, I can give you more specific advice!
March 8, 2025 at 11:07 am #17437::May I share my code to check if there an error or if miss something cause the heart is not increase or decrease
using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerController : MonoBehaviour { [Header("Horizontal Movement Settings:")] [SerializeField] private float walkSpeed = 1; //sets the players movement speed on the ground [Space(5)] [Header("Vertical Movement Settings")] [SerializeField] private float jumpForce = 45f; //sets how hight the player can jump private float jumpBufferCounter = 0; //store the jump button input [SerializeField] private float jumpBufferFrames; //sets the max amount of frames the jump buffer input is stored private float coyoteTimeCounter = 0; //stores the Grounded() bool [SerializeField] private float coyoteTime; //sets the max amount of frames the Grounded() bool is stored private int airJumpCounter = 0; //keeps track of how many times the player has jumped in the air [SerializeField] private int maxAirJumps; //the max no. of air jumps private float gravity; //stores the gravity scale at start [Space(5)] [Header("Ground Check Settings:")] [SerializeField] private Transform groundCheckPoint; //point at which ground check happens [SerializeField] private float groundCheckY = 0.2f; //how far down from ground check point is Grounded() checked [SerializeField] private float groundCheckX = 0.5f; //how far horizontally from ground check point to the edge of the player is Grounded() checked [SerializeField] private LayerMask whatIsGround; //sets the ground layer [Space(5)] [Header("Dash Settings:")] [SerializeField] private float dashSpeed; //speed the dash [SerializeField] private float dashTime; //amount of time spent dashing [SerializeField] private float dashCooldown; //amount of time between dashes [SerializeField] GameObject dashEffect; private bool canDash = true, dashed; [Space(5)] [Header("Attack Setting: ")] [SerializeField] private Transform SideAttackTransform; //the middle of the side attack area [SerializeField] private Vector2 SideAttackArea; //how large the area of side attack is [SerializeField] private Transform UpAttackTransform; //the middle of the up attack area [SerializeField] private Vector2 UpAttackArea; //how large the area of side attack is [SerializeField] private Transform DownAttackTransform; //the middle of the down attack area [SerializeField] private Vector2 DownAttackArea; //how large the area of side attack is [SerializeField] private LayerMask attackableLayer; //the layer the player can attack and recoil off of [SerializeField] private float timeBetweenAttack; private float timeSinceAttack; [SerializeField] private float damage; //the damage the player does to an enemy [SerializeField] private GameObject slashEffect; //the effect of the slashs bool restoreTime; float restoreTimeSpeed; [Space(5)] [Header("Recoil Setting: ")] [SerializeField] private int recoilXSteps = 5; //how many FixedUpdates() the player recoils Horizontally for [SerializeField] private int recoilYSteps = 5; //how many FixedUpdates() the player recoils vertically for [SerializeField] private float recoilXSpeed = 100; //the speed of horizontal recoil [SerializeField] private float recoilYSpeed = 100; //the speed of vertical recoil private int stepXRecoiled, stepYRecoiled; //the no. of steps recoiled horizontally and verticall [Space(5)] [Header("Health Setting: ")] public int health; public int maxHealth; [SerializeField] GameObject bloodSpurt; [SerializeField] float hitFlashSpeed; public delegate void OnHealthChangedDelegate(); [HideInInspector] public OnHealthChangedDelegate onHealthChangedCallback; float healTimer; [SerializeField] float timeToHeal; [Space(5)] [HideInInspector] public PlayerStateList pState; private Animator anim; private Rigidbody2D rb; private SpriteRenderer sr; //input Variables private float xAxis, yAxis; private bool attack = false; public static PlayerController Instance; private void Awake() { if(Instance != null && Instance != this) { Destroy(gameObject); } else { Instance = this; } health = maxHealth; } // Start is called before the first frame update void Start() { pState = GetComponent<PlayerStateList>(); rb = GetComponent<Rigidbody2D>(); sr = GetComponent<SpriteRenderer>(); anim = GetComponent<Animator>(); gravity = rb.gravityScale; } private void OnDrawGizmos() { Gizmos.color = Color.red; Gizmos.DrawWireCube(SideAttackTransform.position, SideAttackArea); Gizmos.DrawWireCube(UpAttackTransform.position, UpAttackArea); Gizmos.DrawWireCube(DownAttackTransform.position, DownAttackArea); } // Update is called once per frame void Update() { GetInputs(); UpdateJumpVariables(); if (pState.dashing) return; Flip(); Move(); Jump(); StartDash(); Attack(); restoreTimeScale(); FlashWhileInvincible(); Heal(); } private void FixedUpdate() { if (pState.dashing) return; Recoil(); } void GetInputs() { float prevAxis = xAxis; float prevYaxis = yAxis; bool prevAttack = attack; xAxis = Input.GetAxisRaw("Horizontal"); yAxis = Input.GetAxisRaw("Vertical"); attack = Input.GetButtonDown("Attack"); if (prevAxis != xAxis || prevYaxis != yAxis || prevAttack != attack) { Debug.Log("xAxis: " + xAxis + ", yAxis: " + yAxis + ", Attack: " + attack); } } void Flip() { if(xAxis < 0) { transform.localScale = new Vector2( -Mathf.Abs(transform.localScale.x), transform.localScale.y); pState.lookingRight = false; } else if (xAxis > 0) { transform.localScale = new Vector2( Mathf.Abs(transform.localScale.x), transform.localScale.y); pState.lookingRight = true; } } private void Move() { rb.velocity = new Vector2(walkSpeed * xAxis, rb.velocity.y); Debug.Log("Player Velocity: " + rb.velocity); anim.SetBool("Walking", rb.velocity.x != 0 && Grounded()); } void StartDash() { if (Input.GetButtonDown("Dash") && canDash && !dashed) { StartCoroutine(Dash()); } if (Grounded() && !pState.dashing) { dashed = false; } } IEnumerator Dash() { canDash = false; pState.dashing = true; anim.SetTrigger("Dashing"); rb.gravityScale = 0; rb.velocity = new Vector2(transform.localScale.x * dashSpeed, 0); Debug.Log("Dashing at speed: " + dashSpeed); if (Grounded() && dashEffect != null) { Instantiate(dashEffect, transform.position, Quaternion.identity); } yield return new WaitForSeconds(dashTime); rb.gravityScale = gravity; pState.dashing = false; rb.velocity = new Vector2(transform.localScale.x * (dashSpeed * 0.5f), rb.velocity.y); Debug.Log("Dash ended."); yield return new WaitForSeconds(dashCooldown); canDash = true; } void Attack() { timeSinceAttack += Time.deltaTime; if(attack && timeSinceAttack >= timeBetweenAttack) { timeSinceAttack = 0; anim.SetTrigger("Attacking"); Debug.Log("Player Attacked!"); if(yAxis == 0 || yAxis < 0 && Grounded()) { Hit(SideAttackTransform, SideAttackArea, ref pState.recoilingX, recoilXSpeed); Instantiate(slashEffect, SideAttackTransform); } else if(yAxis > 0) { Hit(UpAttackTransform, UpAttackArea, ref pState.recoilingY, recoilYSpeed); SlashEffectAtAngle(slashEffect, 80, UpAttackTransform); } else if(yAxis < 0 && !Grounded()) { Hit(DownAttackTransform, DownAttackArea, ref pState.recoilingY, recoilYSpeed); SlashEffectAtAngle(slashEffect, -90, DownAttackTransform); } } } void Hit(Transform _attackTransform, Vector2 _attackArea, ref bool _recoilDir, float _recoilStrength) { Collider2D[] objectsToHit = Physics2D.OverlapBoxAll(_attackTransform.position, _attackArea, 0, attackableLayer); List<Enemy> hitEnemies = new List<Enemy>(); Debug.Log("Hit Detected: " + objectsToHit.Length + " targets"); if(objectsToHit.Length > 0) { _recoilDir = true; } for (int i = 0; i < objectsToHit.Length; i++) { Enemy e = objectsToHit[i].GetComponent<Enemy>(); if(e && !hitEnemies.Contains(e)) { e.EnemyHit(damage, (transform.position - objectsToHit[i].transform.position).normalized, _recoilStrength); hitEnemies.Add(e); } } } void SlashEffectAtAngle(GameObject _slashEffect, int _effectAngle, Transform _attackTransform) { _slashEffect = Instantiate(_slashEffect, _attackTransform); _slashEffect.transform.eulerAngles = new Vector3(0, 0, _effectAngle); _slashEffect.transform.localScale = new Vector2(transform.localScale.x, transform.localScale.y); } void Recoil() { if(pState.recoilingX) { if(pState.lookingRight) { rb.velocity = new Vector2(-recoilXSpeed, 0); } else { rb.velocity = new Vector2(recoilXSpeed, 0); } } if(pState.recoilingY) { rb.gravityScale = 0; if(yAxis < 0) { rb.velocity = new Vector2(rb.velocity.x, recoilYSpeed); } else { rb.velocity = new Vector2(rb.velocity.x, -recoilYSpeed); } airJumpCounter = 0; } else { rb.gravityScale = gravity; } //stop recoil if(pState.recoilingX && stepXRecoiled < recoilXSteps) { stepXRecoiled++; } else { StopRecoilX(); } if(pState.recoilingY && stepYRecoiled < recoilYSteps) { stepYRecoiled++; } else { StopRecoilY(); } if(Grounded()) { StopRecoilY(); } } void StopRecoilX() { stepXRecoiled = 0; pState.recoilingX = false; } void StopRecoilY() { stepYRecoiled = 0; pState.recoilingY = false; } public void TakeDamage(float _damage) { health -= Mathf.RoundToInt(_damage); StartCoroutine(StopTakingDamage()); } IEnumerator StopTakingDamage() { pState.invincible = true; GameObject _bloodSpurtParticles = Instantiate(bloodSpurt, transform.position, Quaternion.identity); Destroy(_bloodSpurtParticles, 1.5f); anim.SetTrigger("TakeDamage"); yield return new WaitForSeconds(1f); pState.invincible = false; } void FlashWhileInvincible() { sr.material.color = pState.invincible ? Color.Lerp(Color.white, Color.black, Mathf.PingPong(Time.time * hitFlashSpeed, 0.1f)) : Color.white; } void restoreTimeScale() { if(Time.timeScale < 1) { Time.timeScale += Time.deltaTime * restoreTimeSpeed; } else { Time.timeScale = 1; restoreTime = false; } } public void HitStopTime(float _newTimeScale, int _restoreSpeed, float _delay) { restoreTimeSpeed = _restoreSpeed; Time.timeScale = _newTimeScale; if(_delay > 0) { StopCoroutine(StartTimeAgain(_delay)); StartCoroutine(StartTimeAgain(_delay)); } else { restoreTime = true; } } IEnumerator StartTimeAgain(float _delay) { restoreTime = true; yield return new WaitForSeconds(_delay); } public int Health { get { return health;} set { if(health != value) { health = Mathf.Clamp(value, 0, maxHealth); if(onHealthChangedCallback != null) { onHealthChangedCallback.Invoke(); } } } } void Heal() { if(Input.GetButton("Healing") && Health < maxHealth && !pState.jumping && !pState.dashing) { pState.healing = true; //healing healTimer += Time.deltaTime; if(healTimer >= timeToHeal) { Health++; healTimer = 0; } } else { pState.healing = false; healTimer = 0; } } public bool Grounded() { if (Physics2D.Raycast(groundCheckPoint.position, Vector2.down, groundCheckY, whatIsGround) || Physics2D.Raycast(groundCheckPoint.position + new Vector3(groundCheckX, 0, 0), Vector2.down, groundCheckY, whatIsGround) || Physics2D.Raycast(groundCheckPoint.position + new Vector3(-groundCheckX, 0, 0), Vector2.down, groundCheckY, whatIsGround)) { return true; } else { return false; } } void Jump() { if(Input.GetButtonUp("Jump") && rb.velocity.y > 0) { rb.velocity = new Vector2(rb.velocity.x, 0); Debug.Log("Jump Cancelled: Falling Down"); pState.jumping = false; } if (!pState.jumping) { if (jumpBufferCounter > 0 && coyoteTimeCounter > 0) { rb.velocity = new Vector3(rb.velocity.x, jumpForce); pState.jumping = true; Debug.Log("Jump Triggered: " + jumpForce); } else if(!Grounded() && airJumpCounter < maxAirJumps && Input.GetButtonDown("Jump")) { pState.jumping = true; airJumpCounter++; rb.velocity = new Vector3(rb.velocity.x, jumpForce); Debug.Log("Air Jump Triggered: " + airJumpCounter); } } anim.SetBool("Jumping", !Grounded()); } void UpdateJumpVariables() { if (Grounded()) { pState.jumping = false; coyoteTimeCounter = coyoteTime; airJumpCounter = 0; } else { coyoteTimeCounter -= Time.deltaTime; } if (Input.GetButtonDown("Jump")) { jumpBufferCounter = jumpBufferFrames; } else { jumpBufferCounter = jumpBufferCounter - Time.deltaTime * 10; } } }
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class HeartController : MonoBehaviour { PlayerController player; private GameObject[] heartContainers; private Image[] heartFills; public Transform heartsParent; public GameObject heartContainerPrefab; // Start is called before the first frame update void Start() { player = PlayerController.Instance; heartContainers = new GameObject[PlayerController.Instance.maxHealth]; heartFills = new Image[PlayerController.Instance.maxHealth]; PlayerController.Instance.onHealthChangedCallback += UpdateHeartsHUD; InstantiateHeartContainers(); UpdateHeartsHUD(); } // Update is called once per frame void Update() { } void SetHeartContainers() { for(int i = 0; i < heartContainers.Length; i++) { if(i < PlayerController.Instance.maxHealth) { heartContainers[i].SetActive(true); } else { heartContainers[i].SetActive(false); } } } void SetFilledHearts() { for(int i = 0; i < heartFills.Length; i++) { if(i < PlayerController.Instance.health) { heartFills[i].fillAmount = 1; } else { heartFills[i].fillAmount = 0; } } } void InstantiateHeartContainers() { for(int i = 0; i < PlayerController.Instance.maxHealth; i++) { GameObject temp = Instantiate(heartContainerPrefab); temp.transform.SetParent(heartsParent, false); heartContainers[i] = temp; heartFills[i] = temp.transform.Find("HeartFill").GetComponent<Image>(); } } void UpdateHeartsHUD() { SetHeartContainers(); SetFilledHearts(); } }
March 8, 2025 at 11:11 am #17438::Thank you for sharing your code! Let’s go through your
PlayerController
andHeartController
scripts to identify potential issues that could prevent the heart system from functioning as expected, specifically regarding increasing or decreasing health.Possible Issues to Check:
-
Health Initialization:
- Ensure that
maxHealth
is set to a value greater than 0 in the Unity Inspector. If it’s 0 or uninitialized, health won’t be able to increase or decrease.
- Ensure that
-
Health Delegate:
- In your
PlayerController
, you have an eventonHealthChangedCallback
. Make sure that this delegate is correctly invoked whenever health changes. You already have it set up in theHealth
property, but you should also ensure that theTakeDamage
method correctly invokes it.
- In your
-
Health Changes:
- Verify that the
TakeDamage
method is being called when the player takes damage. You can add debug statements to confirm that the method is triggered and that health decreases appropriately.
- Verify that the
-
Healing Logic:
- In the
Heal
method, you’re checking for input to heal. Ensure that the input for “Healing” is correctly set up in Unity’s Input Manager. Also, check that the conditions for healing (Health < maxHealth
,!pState.jumping
, and!pState.dashing
) are satisfied in your game scenario.
- In the
-
Updating Hearts:
- The
UpdateHeartsHUD
method inHeartController
is correctly hooked to theonHealthChangedCallback
. However, make sure that theHealth
property setter inPlayerController
is being called when health changes (both for damage and healing).
- The
Debugging Steps:
-
Add Debug Logs: Use
Debug.Log
in key places:- Inside
TakeDamage
to see when damage is applied. - Inside
Heal
to see when healing is attempted and the conditions that lead to health changes. - Inside
UpdateHeartsHUD
to confirm when the UI updates.
- Inside
-
Check Health Value: In the inspector or with debug logs, monitor the value of
health
andmaxHealth
after damage and healing operations. -
Heart Container Visibility: Ensure that the heart containers are being instantiated correctly and that their visibility is toggled based on the player's health.
Suggested Changes:
-
TakeDamage Method: Make sure to invoke the health change callback:
public void TakeDamage(float _damage) { Health -= Mathf.RoundToInt(_damage); // Use the Health property to invoke callback. StartCoroutine(StopTakingDamage()); }
-
Heal Method Adjustments: You might want to add a debug log to see if healing is attempted:
void Heal() { if(Input.GetButton("Healing") && Health = timeToHeal) { Health++; // This will invoke onHealthChangedCallback healTimer = 0; } } else { pState.healing = false; healTimer = 0; } }
By following these suggestions and debugging steps, you should be able to identify the issue with the heart system and ensure it updates correctly when the player’s health changes. If you have any specific errors or behaviors you’re observing, please share them for more targeted help!
March 8, 2025 at 3:38 pm #17439::@32sitifajrinmaulidiya let me know if Ser Apustaja’s solutions help. If not, can you take a screenshot of the Heart Controller and Player Controller components in the Inspector? So that I can check if everything is assigned correctly.
Check the Console to see if there are any errors as well.
March 9, 2025 at 9:08 pm #17456::View post on imgur.com
this is the heart container’s inspector.
this is the HeartFill’s inspector.
this is the player’s img_1
this is the player’s img_2
ths is the player’s img-3
this is the player’s img_4
are these is what you mean?
March 9, 2025 at 9:10 pm #17457::It looks like you’re trying to share images related to your project, possibly for a game or UI design. However, I can’t view images directly. If you have specific questions about your code or need help with a particular aspect of your project, please describe the issue or paste the relevant code snippets here. This way, I can assist you better!
March 10, 2025 at 1:23 am #17458::@32sitifajrinmaulidiya there seem to be 2 things that are wrong. First, in the PlayerController, the Health attribute is set to 0.
2nd, have you attached the
HeartController
script to any component? The script is responsible for updating the health bar.You can also refer to this post, which summarises a list of common issues people have with the heart containers not updating: https://blog.terresquall.com/community/topic/part-4-missing-video-content-common-issues-fixes/
March 10, 2025 at 2:51 pm #17468::So what should I do now? change the health value attribute? should I put the Script heartController to Player too?
March 10, 2025 at 2:55 pm #17469::It sounds like you’re working on a game or a simulation involving health values and possibly player interactions. Here’s a general approach you might consider:
-
Change the Health Value Attribute: If you want to modify the health of the player, you should definitely change the health value attribute in your player class or script. Ensure you have a way to access and modify this value, whether directly or through methods.
-
Script Placement: If
heartController
is responsible for managing the health (like displaying health, updating it based on events, etc.), it might make sense to attach it to the Player object. This way, the heartController can directly manipulate the player’s health attribute and respond to player events (like taking damage or healing). -
Communication Between Scripts: If you decide to keep
heartController
as a separate script, make sure you have a way for it to communicate with the Player script. This could be done through public methods, events, or direct references. -
Testing: After making these changes, make sure to test your game to ensure that the health mechanics work as expected. Look out for bugs like health not updating correctly, or the UI not reflecting the health status.
If you provide more context or specifics about your setup (e.g., programming language, game engine, current code snippets), I can give more tailored advice!
March 10, 2025 at 3:13 pm #17470March 10, 2025 at 3:15 pm #17471::It looks like you’re working on a game and you’re trying to set the health value to 10, but it’s not behaving as expected. To help you better, could you please share the relevant code snippet where you’re setting the health value? Additionally, let me know what language and framework you are using for your game. This will help me provide more specific guidance.
-
-
AuthorPosts
- You must be logged in to reply to this topic.
Advertisement below: