We wanted the ability to see the fish swimming in the water, so you could throw your fishing rod in and the fish you wanted to catch would go to it. However, due to a glitch with the animation gizmos and a saving bug, we had to remove it.
In our opinion, this should still count for 'How Did They Do That?' since it took a lot of time to implement, and the only reason we had to remove it was due to Rooms V2.
The first step is to check if you're fishing!
What I used are two raycasts: one that follows your camera's forward vector to see if you're looking at water, and another that casts downward to check if you're standing on the ground.
What I did here was pretty simple: the fishing hook moves to a random position, and when it reaches that position, it moves to a new random position. The fishing hook also has a random wait time (between 5 and 20 seconds), after which you get a quick-time event that lasts 0.75 seconds.
I based the fishing mechanic on the Stardew Valley fishing minigame. I created it in four parts: Bar Movement, Fish Movement, Fish Inside Bar, and Fish Types.
Bar Movement: I implemented bar movement by checking if the player is holding the interaction volume. If they are, I increase a velocity float if not, the velocity decreases. This velocity is then used to update the bar's position. If the bar reaches the bottom, the velocity is inverted to simulate a bounce effect.
Fish Movement: The fish movement starts by choosing a random position within a range defined by FishMaxTravelDistance. The fish then moves (lerps) toward that target position using the FishSpeed value.
Fish Inside Bar: To check if the fish is inside the bar, I use a simple math equation. If the fish is inside the bar, a progress float increases by 0.2. If it’s outside, the progress decreases by 0.5. The visual progress bar is represented using two text objects with the symbol |. I also interpolate (lerp) between two color values to show progress.When the progress reaches 52, the minigame ends.
Fish Types: We created 12 different fish types, each with unique colors, speed, travel distance, and rarity.
FishName-
Bluegill^Roach Fish^Perch^Crucian Carp^Carp^Largemouth^Drum^Pike^Trout^Walleye^Sturgeon^Gold Fish
ColorString-
#10334E^#787D7E^#443B38^#367694^#423F3B^#2A4136^#1D3147^#3B5E37^#785C82^#152B2F^#07242D^#ffd700
FishSpeedString-
0.0100^0.0127^0.0155^0.0182^0.0209^0.0236^0.0264^0.0291^0.031^0.032^0.033^0.055
FishMaxTravelDistanceString-
0.200^0.273^0.345^0.418^0.491^0.564^0.636^0.7^0.7^0.7^0.7^0.35
FishRarityString-
16.2727^14.6455^13.0182^11.3909^10.000^9.7636^8.1364^6.5091^4.8818^3.2545^1.6273^0.5000
I wanted to give you the ability to see the fish you caught, along with the count. I first used Replicator and then the Animation Gizmo to show the fish, but those options were really broken. So, I ended up using a rotator under the map that has all the fish connected. However, in the end, there were Two Bugs with it that I couldn't patch due to RoomsV2.