Search Unity

Looking for a place to start

Discussion in 'Getting Started' started by xKiraxAlbionx, Oct 16, 2017.

  1. xKiraxAlbionx

    xKiraxAlbionx

    Joined:
    Oct 16, 2017
    Posts:
    1
    Hey everyone,

    Sorry if this is in the wrong place, I'm rather new to the forum scene.

    So I'm extremely new when it comes to any sort of game design with unity. I've been working on a Unity3D VR experience for a final class of mine basing everything from tutorials and everything I can find online. I've got my assets and everything brought into unity (character hands, arena, enemy bots) etc. The thing that I'm struggling with the most is scripting c+. I took a bit of computer science based courses at the beginning of my high school year and now I'm a senior in college so everything I've learned is kinda isn't really there anymore. I have some scripting stuff down. Like when you pull the trigger a blast comes from the 3d hand. I'm also using a tool called VRTK (Virtual Reality Tool Kit); which, has been a huge help with most of it, but to help really bring the experience alive there is some scripting that I want to implement. Such as:

    *I have two modes: Flight and fire. 1 script (found in a vive tutorial) allows you to fly around based on how the controllers are pointed. The second script obviously allows you to fire a projectile. However when I switch to the fire mode the flight script is still active. So I need to make a script that will disable the flight script when the fire script is active and vice versa.
    *Getting the enemy bots to move around the arena I have made.
    *Attaching a forearm to the hand to help make it seem more realistic (this one is just a bonus, not sure if that's something I can even do) <-- not sure if this would be even scripting based. I was thinking of having an invisible game object that the forearm follows around x,y,z axis wise and have the invisible object attached to the hand.

    This is kind of long sorry about that, I'm getting rather desperate in finding something to help me get this along. Most tutorials I find don't seem to work, but maybe I'm just not looking in the right places. So if anyone knows a place where I can start or has any ideas for me, I really appreciate it.

    Thanks in advance.
     
  2. jchester07

    jchester07

    Joined:
    Jun 28, 2016
    Posts:
    24
    Great project you got there. I also once created a simple VR game but it's not yet finish and I'm only using GoogleVR.

    Back to your concerns.
    1.) Generally, enabling and disabling components is fairly simple. This is just an example.
    Code (CSharp):
    1. public FlightScript flight;
    2. public FireScript fire;
    3.  
    4. void Start()
    5. {
    6.     flight.enabled = true;
    7.     fire.enabled = false;
    8. }
    9.  
    10. void Update()
    11. {
    12.     if(Input.GetButtonDown("Fire1")){
    13.             SwitchMode();
    14.         }
    15. }
    16.  
    17. public void SwitchMode()
    18. {
    19.     flight.enabled = !flight.isActiveAndEnabled;
    20.     fire.enabled = !flight.isActiveAndEnabled;
    21. }
    2.) You can use unity's Navigation and Pathfinding.
    3.) I don't know how HTC Vive works but if that "hand" you say is a gameobject in unity then you make your forearm a child of that gameobject directly.