✅ 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•5mo ago
Message Not Public
Sign In & Join Server To View
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!
here's the important part
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View
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•5mo ago
Message Not Public
Sign In & Join Server To View
no?
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View
how do I formatted
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View
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!
$paste
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•5mo ago
Message Not Public
Sign In & Join Server To View
nah
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View
how do I send it
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View
BlazeBin - ddwbjccjxhhc
A tool for sharing your source code with the world!
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View
Nah I think you can help me
you just won't
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View
wdym
Bruh Im not reading bot texts
I supposed it was just some mumbo jumbo
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View
then why not help them
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View
you're spreading straight shit
wdym
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View
I mean you started not wanting to help me
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View
like you've come here with the attitude
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View