Hey everyone,
First time posting here. I'm just getting started with modding and decided to try something simple with Merge Fellas, but I've already hit a wall with a frustrating bug.
My goal is to add a small camera shake effect every time two fellas merge. I've written a C# script in Unity to handle this, but I've run into a problem: the merge fellas unlimited shake bug. Basically, the shake starts correctly on the first merge, but it never stops. It just keeps shaking forever, making the game unplayable.
I've been staring at my code for hours and I'm pretty sure the problem is in my Coroutine's while loop, but I can't see the logical error. I think the timer isn't decreasing correctly or the condition is always true.
I've put the script into a Google Doc to keep this post clean and easy to read. It would be a huge help if someone with more experience could take a quick look and point out my stupid mistake. I'm sure it's something obvious I'm missing.
Here's the link to the script:
https://docs.google.com/document/d/1eN-xA_C4f7uPZJTO-0czssdHiFRDjiBXm82y2c5rL84/edit?usp=sharing
I'm trying to learn, so any explanation of why it's wrong would be amazing.
Thanks in advance for any help!
First time posting here. I'm just getting started with modding and decided to try something simple with Merge Fellas, but I've already hit a wall with a frustrating bug.
My goal is to add a small camera shake effect every time two fellas merge. I've written a C# script in Unity to handle this, but I've run into a problem: the merge fellas unlimited shake bug. Basically, the shake starts correctly on the first merge, but it never stops. It just keeps shaking forever, making the game unplayable.
I've been staring at my code for hours and I'm pretty sure the problem is in my Coroutine's while loop, but I can't see the logical error. I think the timer isn't decreasing correctly or the condition is always true.
I've put the script into a Google Doc to keep this post clean and easy to read. It would be a huge help if someone with more experience could take a quick look and point out my stupid mistake. I'm sure it's something obvious I'm missing.
Here's the link to the script:
https://docs.google.com/document/d/1eN-xA_C4f7uPZJTO-0czssdHiFRDjiBXm82y2c5rL84/edit?usp=sharing
I'm trying to learn, so any explanation of why it's wrong would be amazing.
Thanks in advance for any help!