This post is a little different than before and that is because I will not be working on The Krilling for this post! I will be completing a role analysis project where we decided to all create a "unique movement system". This project was quite difficult, even just coming up with an idea took considerable time. I will walk you through the process on how I did what I did.
I started with an empty Unity Project and put in some basic things to get started. I put in a plane for the floor, a capsule for the "player" and then some basic code for controlling the capsule and moving the camera along with it. Those can all be found here:
This setup was actually something I have not done for awhile so as a refresher I used this video so I could spend more time on making the movement unique.
With this system in place I could move, jump (with a ground check), and move the camera with the player, so I was now ready to start making this system unique. At this point in the porject, I had not really put a lot of thought into what I wanted to do for the system. All I had really decided was that "gravity is cool" and I kind of wanted to try using something weird with gravity, but it also seemed like a weird system to work with in Unity. I may revisit this idea one day for myself, but a secondary idea that honestly followed a little closer to what I wanted anyways was MAGNETS. So, I looked for a video tutorial to see if such a thing was reasonable in Unity and after watching this video I decided that it looked perfect for what I wanted to try.
So, I made a cube that I could then attach a translucent magnet zone to and implemented the tutorial with a couple initial tweaks to work for my case and this is what I ended up with:
This is... close! I don't think I want them to work passively, but instead when the player is in the zone I would like to have them press a button to get pulled in and so the magnets would only work while the player is holding down a certain key. This will also hopefully allow for a different keybind to allow the player to reverse the force and get pushed away which I am also interested in. Once these functionalities are working I also think the player will not need the jump anymore, which is what I am trying to design around.
In order to achieve this control over the magnetization, I simply added some conditionals checking for the key being held down and then applied force appropriately. Additonally, I made the cube in the center of the magnet zone larger so than the player could start using it as a platform slightly easier. Here are those changes:
At this point I also removed the jump on spacebar because now there was a new way of traversing, and I wanted to put together a couple obstacle courses to see how well this system functioned. I figured this would be the best way to discover what is possible with this type of system. Here is the level I set up to test many of the different ways this system could be utilized:
The following will be a handful of videos displaying how this system is working within this level.
Traversing to a far off platform:
Used to travel far distances (this is a vertical example but horizontal could also work):
Used to traverse smaller gaps with varying positioning of the magnets:
Overall, this system seems very intriguing to me! Depending on use case within a game various specifics could be changed to create specific feels. The player could target specific blocks by looking at them and it becomes more of a formless grapple hook, the cubes could be changed back to being passively effective and they become obstacles. In a passive functioning mode they could also periodically turn on and off, flinging the player different directions. The use cases are vast!