Qpy
❔ (Due in about two days) Fish Project for C# Unity
As I am super new, it may be hard for me but I will try my best, I have been able to make a "fish" with three variables(type = string, length = float, value = int), however I have no idea how to send that "fish" to another script(FishTank) to be stored I also need to make it so that if the fish stored in the tanks (float) is higher than the other float variables of fish stored they get "eaten". I can do the unity stuff like TMP buttons and possibly figure out displaying text, it's just sending it to the other script and selling fish that I'm struggling with. I can post my updated scrip again. Hopefully I explained it better, I apologise.
10 replies
❔ (Due in about two days) Fish Project for C# Unity
you mean this ? for (int i = 0; i < 1; i++)
{
fishType.Add(Instantiate(fishPrefab, new Vector3(i * 0, 0, 0),Quaternion.identity));
if (fishType[i].GetComponent<FishController>() != null)
{
FishController fishController = fishType[i].GetComponent<FishController>();
print($" You Caught A {FishController.thisType}! The fish is {FishController.thisLength} Long and has a Value of {FishController.thisValue}. What will you do with it");
}
}
10 replies