Skip to content
  • TwistedTwigleg's avatar
    VR tutorial cleanup and code refactor (#3) · 7d1914e4
    TwistedTwigleg authored
    Adds the following commits from PR #3 
    ________________________________________
    
    * Made a bunch of changes to the VR tutorial project.
    
    * Added rumble when objects are picked up, the guns are fired, and when the sword collides with something.
    * Added a raycast "laser sight" to the Shotgun for easier aiming
    * Added a new knockback/collision-force system to the pistol, shotgun, and bomb objects. Now the closer the object is to the collision, the farther it goes.
      * This change also makes the bombs a little more consistent and natural looking.
    * Created a base class, VR_Interactable_Rigidbody, to use for all interactable Rigidbodies in the game.
    * Changed the code within the VR controller to use VR_Interactable_Rigidbody instead of checking for methods.
    * Fixed issue where the shotgun raycasts would send targets towards the player. Now when the shotgun fires, objects hit fly away from the end of the shotgun.
    * Fixed issue where the meshes used for teleportation and raycast-grabbing in the VR controller were initially visible. Now the meshes are only visible when the player starts teleporting and/or changes grab modes.
    * I probably forgot a few minor changes...
    
    * Refactored the VR controller script and moved it into the Scenes folder.
    
    The refactoring is mainly just breaking everything out into smaller functions, with little changes to the code. The comments within the code still need updating/fixing.
    
    Refactoring may have broken/changed the controller velocity stuff. The code itself has not changed, but in my tests I couldn't quite get throwing to work. It might be my VR headset though.
    I will need to do more tests to figure out what is going on.
    
    * Redid the VR sword. Now it is much more accurate and usable, at the cost of needing to use a KinematicBody instead of an Area node. I'm not sure what, if any, performance impact this has.
    The entire sword feels MUCH more realistic now and the code is a lot more compact and easy to understand. In my opinion, any minor performance loss is worth it for the improve collision detection
    and better code.
    
    I also change the damage function in Sphere_Target.gd, as the passed-in transform was not needed.
    
    * Made the main VR gui node its own scene, renamed and moved the Base_Control script to the scenes folder, and moved the GUI script to the scenes folder
    
    * Updated the comments in the code for the first half of the VR project. The Reset_Box, Shotgun, Sphere_Target, Sword, and VR_Controller files still need updating
    
    * Finished updating the comments within all of the code files. Now everything has up-to-date comments explaining what the code does
    
    * Minor fixes and changes made while writing the tutorial for the Godot documentation
    
    * More slight changes made while working on the tutorial rewrite
    
    * Changes made to the reset box script while working on the VR starter tutorial for the Godot documentation
    7d1914e4
This project is licensed under the MIT License. Learn more