C
C#5mo ago
Martiiic

✅ HAVING TROUBLE CALLING A FUNCTION

So I've made an ingame saving system like the one in hollowknight but Im having trouble with something. My enemies despawn when you enter and that's alright until you want to get out the save point, I want the enemies to respawn after exiting the save point but it doesnt. Sorry for bad englsh. CLASS1 Enemic: public void PlayerEnterAltar() { Enemic[] enemies = FindObjectsOfType<Enemic>(); foreach (Enemic enemy in enemies) { enemy.MortSLS = false; enemy.IsDead = false; enemy.CurrentMoveSpeed = enemy.moveSpeed; // Guarda la velocitat actual enemy.moveSpeed = 0f; enemy.gameObject.SetActive(false); } } public void PlayerExitAltar () { Debug.Log("Enemics tornen a apareixer"); Enemic[] enemies = FindObjectsOfType<Enemic>(); foreach (Enemic enemy in enemies) { Debug.Log("Enemics tornen a apareixer"); enemy.gameObject.SetActive(true); enemy.MortSLS = false; enemy.currentHealth = enemy.maxHealth; enemy.moveSpeed = enemy.CurrentMoveSpeed; } } CLASS 2 Player (where PlayerExitAltar and PlayerEnterAltar are called FILE)
32 Replies
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
MODiX
MODiX5mo ago
If your code is too long, you can post to https://paste.mod.gg/, save, and copy the link into chat for others to see your shared code!
Martiiic
MartiiicOP5mo ago
here's the important part
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
Martiiic
MartiiicOP5mo ago
public void JugadorAltarHandler() { PauseDelayBool = false; Enemic.PlayerEnterAltar(); anim.SetTrigger("AltarActivat"); JocPausat = true; currentSpeed = this.velocitat; rb.velocity = Vector3.zero; velocitat = 0f; } public void JugadorAltarLoopAnimation() { anim.SetBool("AltarActivat2", true); StartCoroutine(OpenAltarTab()); } IEnumerator OpenAltarTab() { yield return new WaitForSeconds(2.4f); AltarMenu.OpenAltarMenu(); InAltarMenu = true; } public void JugadorExitAltarHandler() { anim.SetBool("AltarActivat2", false); anim.SetTrigger("ExitAltar"); Enemic.PlayerExitAltar(); this.velocitat = currentSpeed; }
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
Martiiic
MartiiicOP5mo ago
no?
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
Martiiic
MartiiicOP5mo ago
how do I formatted
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
MODiX
MODiX5mo ago
If your code is too long, you can post to https://paste.mod.gg/, save, and copy the link into chat for others to see your shared code!
Martiiic
MartiiicOP5mo ago
MODiX
MODiX5mo ago
If your code is too long, you can post to https://paste.mod.gg/, save, and copy the link into chat for others to see your shared code!
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
Martiiic
MartiiicOP5mo ago
nah
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
Martiiic
MartiiicOP5mo ago
how do I send it
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
Martiiic
MartiiicOP5mo ago
BlazeBin - ddwbjccjxhhc
A tool for sharing your source code with the world!
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
Martiiic
MartiiicOP5mo ago
Nah I think you can help me you just won't
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
Martiiic
MartiiicOP5mo ago
wdym Bruh Im not reading bot texts I supposed it was just some mumbo jumbo
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
Martiiic
MartiiicOP5mo ago
then why not help them
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
Martiiic
MartiiicOP5mo ago
you're spreading straight shit wdym
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
Martiiic
MartiiicOP5mo ago
I mean you started not wanting to help me
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
Martiiic
MartiiicOP5mo ago
like you've come here with the attitude
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server