Lure Controller Working + Dynamic Water!



Okay, so after all those rough weeks of facing all kinds of errors, I've successfully managed to implement the preexisting fishing mechanic with a lure controller that lets the player move the lure, and comes with it's own dedicated camera to follow it underwater while fishing for cats! While on the surface it seemed simple enough, switching to a different camera and controller right when a certain action is completed, it was all very tricky to navigate and setup.
The core problem was that the logic required three sequential actions (Disabling Input, Transferring Control, and Attaching the Line) to happen in a specific, unbroken order immediately after the lure spawned. It's basically me having to break down a set of actions to the engine to comprehend and not crash.
At first, I kept getting a scenario where I could cast the lure, but the controller and camera would simply not switch. It was this Fatal Error (Null) Detected message which essentially meant that the engine could not detect exactly when I am casting the lure, and even if that action was performed for it to switch to the lure controller and camera. To resolve this, I had to establish a "Cast Succeeded" Flow, which would check if the lure has been cast, which would give the engine a value, and that value would give it confirmation to go ahead and switch over to the lure's camera and controller.
Second set of issues had to do with the Lure Controller logic. The Lure is currently a spherical object with a simple collider around it, which is attached to the string of our fishing rod. To move this lure, and make it look realistic ( with water physics), I had to do 2 different types of vector math because Unreal Engine refuses to have a combined Vector node for multiple directions. In the screenshot below, pay attention to the "Get Actor Right Vector", and the "Get Actor Up Vector" Nodes. These nodes essentially enable the lure's ability to move horizontally and vertically, respectively. I had originally used the "Get Actor Forward Vector" node, which sounded like it would make the lure move vertically, but it would simply stay at the same height and move forward/backward around the water. And once we take their values we had to multiply each of their float values with their respective vector directions, which were taken from the "Break Vector 2D" Node, and I had to make sure to only insert the Y value for the Horizontal vector, and the X value for the Vertical one, and finally insert both of them into Lure Reference, which I later realized had to be 2 different references for each vector direction (WHY CAN'T IT BE JUST 1 Reference!!!)
Last, but not least, the Control Transfer and Camera Hijack Failures. This was the most annoying thing I've had to deal with in quite a long time. And probably had the most stupid fixes of all time. The issue was that our Camera Did Not Switch, but the Character Still Moved. In my initial approach, I had just used the Set View Target with Blend node (which had a reference to the lure camera), and a Disable Node to ensure that the original camera/controller no longer work once the lure has been cast. But for some reason, this was not enough; the Engine would still not let me switch over to the Lure Controller and its camera. I needed a more robust approach, so I had to upgrade the old logic with 3 more nodes to get it working. These were the "Possess", "Cast to Pawn", and "Enable Input" nodes. The Possess node, like the name suggests, takes a target controller and possesses it, letting the user gain control of its actions. The Cast to Pawn node would take our player's first-person Controller's disabled reference and ask the Possess node to take control of the Lure Controller , Followed by the Enable Input node, which takes our possessed controller and "Enables" it for the controller to start working. So apparently just disabling the old controller was not enough, we had to establish this flow depicted in the screenshot below to finally access of our Lure controller and camera.
Lastly, I also used a plugin called Fluid Ninja, which specializes in Fluid/Gas simulations and imported some of their dynamic water and sand system into our game to use in combination with our fishing mechanic. The Setup was relatively simple with their youtube channel and the fluid ninja project itself containing lots of information and easy to follow steps for anyone to be able to access their simulations!
Get Cat Fishing
Cat Fishing
Drop the toy, hook a paw, and reel in the chaos!
More posts
- Jose DevLog #4 - ChAoTic 🐱13 hours ago
- Final Week? And there's Cats?21 hours ago
- new update part 27 days ago
- new update15 days ago
- DevLog W2 - Pradyumna TS21 days ago
- Jose DevLog #1: UI and Style28 days ago
- dev vlog post 1 cat fishing game - Soham Kumai29 days ago
- CatFishing - Controller Updates29 days ago
- DevLog #0: The Crew36 days ago
Leave a comment
Log in with itch.io to leave a comment.