Qpy
Qpy
CC#
Created by Qpy on 7/21/2023 in #help
❔ (Due in about two days) Fish Project for C# Unity
any pointers or pointing out clear errors would be great, I'm having a lot of trouble with this class XD If it could be explained like I'm stupid that would be great lol
10 replies
CC#
Created by Qpy on 7/21/2023 in #help
❔ (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
CC#
Created by Qpy on 7/21/2023 in #help
❔ (Due in about two days) Fish Project for C# Unity
i realised it was useless and i changed it to grab the created one from the FishController script, now im having trouble sending the created Object to the FishTank script
10 replies
CC#
Created by Qpy on 7/21/2023 in #help
❔ (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