BGP: Refracted Fate – Sliding Doors!
|
Hi, all readers, I will start focusing more on a single thing that I have worked on and instead write about it a more detailed. So, the number of things I showcase will be lower, but hopefully it will be better quality and more interesting. Anyway, let’s get started! This week I will be talking about the slider mechanic that I have been working on in the game!
Sliding, doors and objects!The way the sliding function has been made is very basic in its functionality, but as it fitted our needs I did not feel the need to make a more complicated system. The way it works depends on the object, for example a door would simple just rotate around its pivot point. The door would discourse have a max and minimum rotation it could rotate, stopping it from rotation 360 degree but also stopping it from going true walls etc. Here is a short gif showing it in action:
Moving on to how it setup and works: The object that should be rotated is all their own object with their own logical system handling their rotation, this mostly being because some things need to rotate differently, while other things maybe must move. When the player looks at one of the objects it can interact with (Being detected by a tag the actor has called “Slider”) the cursor change to an open hand to indicate it’s an interact-able object. Continuing the player can then hold down left mouse button, doing so will change the icon to a closed hand, indicating its being interacted with, then when the player move his mouse around the data from the player will be sent over to the object true an interface. The object will than use the data sent from the player to calculate by itself how it should rotate/move. The way I made the base system that for example the door uses is that the velocity is also kept when the player released the mouse, meaning it will continuing opening if released while in motion. Also, when the object hits the end it will bounce back, however most the velocity will be lost while doing it, wish was made simple to stop it from bouncing back to much and close in the players face.
The End!Anyway, that’s all for me this week, be sure to leave a comment if you like/hate the new format! If you have anything specifically you want me to go into more details about or any feedback/comments be sure to write a comment! |
