For some strange reason, my C# scripts won’t run IEnumerator functions. What appears to happen is that the game will just simply NOT execute the functions, and just simply skip them. This phonomenon occurs without any compile errors as I did declare that the script is “using System.Collections;” near the top of the C# class.
Here’s what my code looks like:
void FixedUpdate()
{
// print("Inside of \"FixedUpdate()\" function.");
if(Input.GetButton("Fire1"))
{
print("Received \"fire\" input command.");
Fire();
}
else if (Input.GetButton("Reload"))
{
Reload();
}
else if(Input.GetButton("Fire3"))
{
ChangeFireMode();
}
else if (Input.GetButton("Fire2"))
Launch();
}
...
IEnumerator Fire()
{
print("Inside of \"Fire()\" function.");
...
}
The end result is that the print statement inside of the Fire function is never called.
Is there something that I’m forgetting or am missing here? What could be wrong with my script?