Swinging is one of the main mechanic of my game. That is why making the swinging feeling great in the game was one of my main priority this semester. I had to get help from a lot of tutorials and go through a lot of trial and error. I had to tackle these problems one at a time to get the result that I liked and wanted in my game.
I like how the end product turned out and how smooth the swing looks. The main GIF image in the top shows how the swing works and how the player can swing between the vine anchor points. The image on the bottom left shows the first successful experiment that I had with the swinging effect, when the player was able to swing in a proper manner. The image on the bottom right shows, the player being able to move while swinging, which was not possible to the first phase of the experiment.
I had to go through a lot of trial and error to get the swinging mechanics right and it took a while for me to get it the way I wanted. These are the two problems that took me the longest to solve.
The 'Problem 1' image show one of the first problem that I had when working on the swing. Even though I had the scipt all figured out, I couldn’t get the player to swing and it just kept on bouncing where it stood. I later figured out this was because the engine was not being able to calculate the actual distance between the player and the anchor point.
The 'Problem 2' shows the problem that the character had when throwing the rope from the ground. After the rope attached to the anchor point, I couldn’t move the character around and swing with it. After trying to figure this out for a while, and failing, I just decided to make the swing work only when the character was off the ground, or jumping.