Search Unity

Intro to Shooter Mechanics - Small Copy/Paste error

Discussion in 'Community Learning & Teaching' started by playa1337, Mar 21, 2016.

  1. playa1337

    playa1337

    Joined:
    Jan 19, 2014
    Posts:
    13
  2. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    Morning,

    Might be better to post in the live training so the author has a better chance of seeing it.
    but @Matthew Schell may be able to resolve.
     
  3. siobhangibson

    siobhangibson

    Unity Technologies

    Joined:
    Mar 21, 2016
    Posts:
    8
    Hi playa1337! This is actually in the Learn section, which is different to Documentation (a little confusing, I know; Documentation refers to the Manual and Scripting API) - the lovely community for the Learning and Teaching section is here, and I'll flag this up with the R&D Content team for you now. Thank you!
     
    Last edited: Mar 29, 2016
    theANMATOR2b likes this.
  4. Matthew-Schell

    Matthew-Schell

    Joined:
    Oct 1, 2014
    Posts:
    238
    @playa1337 thanks for the tip, I'll tidy it up.
     
  5. Eco-Editor

    Eco-Editor

    Joined:
    Jun 29, 2016
    Posts:
    71
    Hello,
    I've just finished watching the "intro to shooter mechanics" and I get this little error saying that :
    In "RayCastShooterScript":
    void Update ()
    {
    RaycastHit hit;
    Vector3 rayOrigin = fpsCam.ViewportToWorldPoint(new Vector3 (.5f, .5f, 0)); //NullReferenceException: Object reference not set to an instance of an object

    I've opened a new script, attached to the "parent" of the whole FPS shooter, gun end and the rest.
    And I can't figure out what object is the missing object. I 've checked the script and copy-passed the script.
    I've started a new proj. and the error came back.

    Hope there's a simple solution
    Thank you!