Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Jan 18, 2013 at 03:41 PM by Fattie for the following reason:

Question is off-topic or not relevant

avatar image
0
Question by pwolf · Dec 18, 2012 at 03:35 PM · errorscenebeginnermissing

completely lost noob

So I went back to finish the tutorial I started the other day ( and have been having great difficulty with..) and when I loaded it up, the entire scene was missing, all I had left was the things in the assets directory. When I remade the scene and tried to attach the scripts, it just plain isnt working. No idea whats wrong, I get the following error:

NullReferenceException: Object reference not set to an instance of an object Movement.Update () (at Assets/Scripts/Movement.js:16)

And when I click play the capsule I have attached the movement script to doesn't move. Here are the scripts:

 #pragma strict
 
 var firstStepTex: Texture; 
 
 private var firstStepTaken:boolean;
 private var edgeMargin: float;
 
 function Start()
 {
     edgeMargin = Screen.width * .05;
 }
 
 function playerMoved()
 {
     if(!firstStepTaken)
     {
         unlockAchievement(firstStepTex);
         firstStepTaken = true; 
     }
 }
 
 function unlockAchievement(achievementTex:Texture)
 {
     var go:GameObject = new GameObject("Achievement Object");
     go.transform.position = Vector3(0,0,0);
     go.transform.localScale = Vector3(0,0,0);
     var guitex: GUITexture = go.AddComponent(GUITexture) as GUITexture;
     guitex.texture = achievementTex;
     guitex.pixelInset.width = achievementTex.width;
     guitex.pixelInset.width = achievementTex.height;
     guitex.pixelInset.x = Screen.width - achievementTex.width - edgeMargin;
     guitex.pixelInset.y = Screen.height - achievementTex.height - edgeMargin;
 }
 
 #pragma strict
 
 var achievementManagerScript: AchievementManagerScript; 
 var speed: int = 5;
 private var cc: CharacterController;
 
 function Start ()
 {
     cc = GetComponent(CharacterController);
 }
 
 function Update () 
 {
     if(Input.GetAxis("Horizontal") || Input.GetAxis("Vertical"))
     {
         achievementManagerScript.playerMoved();
     }
     
     cc.Move(-Vector3(Input.GetAxis("Horizontal") * speed * Time.deltaTime, 0,
     Input.GetAxis("Vertical") * speed * Time.deltaTime));
     
 }
 
 function OnTriggerEnter(col: Collider)
 {
     if(col.gameObject.tag == "Coins")
     {
         Destroy(col.gameObject);
     }
 }

Here is a link to the tutorial:

http://cgcookie.com/unity/2011/12/16/creating-an-achievement-system/

Any help to get this tutorial finish is greatly appreciated. Definitely not going to plan so far..

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

  • Sort: 
avatar image
0

Answer by PAEvenson · Dec 18, 2012 at 03:51 PM

my guess is you didnt assign the achievementManagerScript in the inspector.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Follow this Question

Answers Answers and Comments

10 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

error with footsteps script 1 Answer

Switch platform broke my scripts! 4 Answers

IsFinite(outDistanceForShort) error message 1 Answer

Compilation failed because the compiler couldn't be executed. 1 Answer

How to solve a Unity fatal error? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges