Git Product home page Git Product logo

weaponreloadvr's Introduction

Showcase

showcase

How to use it ( PistolController.cs ).

  1. Download NVR and SteamVR assets from AssetStore.

  2. Then put on scene NVRPlayer Prefab ( camera rig ).
    Prefab

  3. Install NewtonVR by pressing "Enable SteamVR" in NVRPlayer prefab.
    install

  4. Inside NVRPlayer(camera rig), select both hands add "SteamVR_TrackedController component(script).
    install

5)Now You need a gun with separate slider.
gun

6)Add Rigidbody and NVRInteractableItem components to the gun.
gun

  1. Add all neccessary colliders for the all pistols parts, but do not add colliders on slider yet!
    gun

  2. Create empty gameobject and name it "Relative Point". Set on on the Slider height.
    gun

  3. Now make two child colliders inside the slider. First one name "Slider Collider", and second one make a bit bigger and name "Slider Trigger"
    gun

  4. "Slider trigger" set as trigger.
    gun

  5. After that, to the "Slider trigger" add "Pistol Controller" component.
    gun

  6. Finally set all neccessary variables:
    -12.1 Current Object Item - set your gun itself.
    -12.2 Relative Point - set your empty gameobject called "Relative point" which we created on the step 8.
    -12.3 This gun Slider - add guns Slider gameobject.
    gun

Done! Pistol is ready!

Sniper Bolt Controller (sniperBoltController.cs):

All procedure is 80% same as with pistol, but for bolt action we need more movements and different sequence. So to simplify it for now, I decided to make it using animations.

  1. You need to add animator controller to the slider (bolt), and record 3 animations: boltIdle, BoltRotate, boltSlide. Each animation is should be 1 frame length, cuz transition will be automatic.
    boltIdle - is just an idle animation. BoltRotate - is 55 degree rotate animation. boltSlide - is the Z axis move animation.

  2. In animator controller you need to add 2 float parametrs: BoltRotate, BoltSlide.
    gun

  3. Then add first blend tree and add 2 motions ( boltIdle and BoltRotate) and one another blendtree in "Motion" section. All blending should depend from "BoltRotate" parameter, and set threshold as on screenShot:
    gun

  4. In second blend tree add 2 motions: (BoltRotate and boltSlide(I have mistake in animation name - blotSlide :D)) and make them blend under "BoltSlide" parameter.
    gun

That's how it's might look like:
gun

So, That's it!
All contributions are welcome :)

weaponreloadvr's People

Contributors

oyshoboy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.