I was making a simple car parking game, the situation is as follows :   Script oncollision : using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement;  public class oncollision : MonoBehaviour {    public int pscene;    public Rigidbody rb;    public string ascene;     // Start is called before the first frame update    void Start()    {        gettingscene();        Debug.Log(ascene);    }     // Update is called once per frame    void Update()    {        if(rb.position.y &lt; -0.75f)         {            rb.transform.position = new Vector3(-1, 0.5f, -9);        }    }      void OnCollisionEnter(Collision collision)    {       if(collision.collider.tag == &quot;obstacle&quot;)         {            Debug.Log(&quot;will this work?&quot;);            SceneManager.LoadSceneAsync(&quot;GameLost&quot;);            SceneManager.LoadScene(&quot;GameLost&quot;);        }     }    public void gettingscene()    {       ascene = SceneManager.GetActiveScene().name;    }  }  script tryagain : using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement;  public class tryagain : MonoBehaviour {          // Start is called before the first frame update     void Start()     {         FindObjectOfType&lt;oncollision&gt;();     }      // Update is called once per frame     void Update()     {              }      public void tryagainlol()     {         SceneManager.LoadScene(FindObjectOfType&lt;oncollision&gt;().ascene);     } }  As you can see, I made a string in the script oncollision named as ascene, and I stored the active scene name and made the string public. In the function OnCollisionEnter, I loaded the GameLost scene. In that scene I made 3 buttons, namely &quot;try again&quot;, &quot;Quit&quot; and &quot;Main menu&quot;. I still need to make the main menu, o don't focus on that. I made a script known as tryagain, which I added to the button &quot;Try again&quot;. On the script I made a function named &quot;tryagainlol&quot; and I called the ascene string to load the previous scene, but when I test it in game, I get this error. Could anyone explain why do I get this, and how do I resolve it? My complete error says :- NullReferenceException: Object reference not set to an instance of an object                            tryagain.tryagainlol () (at Assets/tryagain.cs:23)  Any help would be appreciated, thanks in advance Also, I found a similar question , but I was unable to apply and understand it in my situation.
Since many users are facing the NullReferenceException: Object reference not set to an instance of an object error in Unity, I thought that it would be a good idea to gather from multiple source some explanation and ways to fix this error.  Symptoms I am getting the error below appearing in my console, what does it mean and how do I fix it?  NullReferenceException: Object reference not set to an instance of an object
Who wrote about an energy free space elevator? Should it be obvious that independent quantum states are composed by taking the tensor product? USB Charge and data separate cables Is it possible to split micro USB to USB cable so two cables (data + and data -) go to the PC with USB and two other power cables go to power brick? I have fought the pumpkin moon and died like 3 times and made it to wave 7 or 6 whenever the pumpking first appears. I have full turtle armor and my primary melee weapon is a demon sickle. I also have the possessed hatchet, magnet sphere, and sniper rifle. I also have other gear like the Uzi. What should I replace, what should I take out, and what should I add? Thanks! I have a Spring MVC web app which uses Spring Security.  I want to know the username of the currently logged in user.  I'm using the code snippet given below .  Is this the accepted way?    I don't like having a call to a static method inside this controller - that defeats the whole purpose of Spring, IMHO.  Is there a way to configure the app to have the current SecurityContext, or current Authentication, injected instead?      @RequestMapping(method = RequestMethod.GET)   public ModelAndView showResults(final HttpServletRequest request...) {     final String currentUser = SecurityContextHolder.getContext().getAuthentication().getName();     ...   } I've set my Units (in scene properties) to Metric, and the Scene Scale to 0.01 hoping to get the Blender dimensions it mm's. While the (normal) scale is 1 for x,y,z, the standard cube has the dimensions 2x2x2 cm. When I export this to an STL and open it in a slicing program (Netfabb, Slic3r or Cura) they all give the dimensions: 2x2x2 mm. While exporting, the scale is 1.  What am I doing wrong? I hope you can help me.  Thanks! Captured variable in a loop in C# I have just had my broadband upgraded to  which means my router has had to change. Previously I was using a Thomson TG585v7 ADSL thingy provided by my ISP. One nice thing about that router was that it would act as a local DNS and allow me to find my other machines on the network by using &lt;hostname&gt;.lan instead of IP addresses.  I've now switched to a Linksys WRT320N ethernet router which connects to my fibre modem, and which I've updated to the latest firmware (1.0.04). I have 2 machines on the network which I regularly want to connect to each other; one is running Windows 7 and the other is running OS X Lion.  The problem I'm having is that I'm unable to connect to my Win7 machine from the OS X machine using the Win7 machine's name. However, I'm able to ping the OS X machine from my Win7 machine using the hostname. Prove that for any prime p, there is a complete set of mod p residues {q1, . . . , qp}, where each qi is prime. I used the theorem {a, a+n, a+ 2n, . . .} contains infinitely many primes if gcd(a, n) = 1 but haven't got much progress. Any comment will be helpful! Egg replacer for bread dough? I've been reading (most) questions and answers (here) about baking bread (which I love) and how to replace eggs in many recipes (which I wish I didn't need). Turns out, I too have egg allergy (not too severe) and a few of my favorite breads require one or more eggs.  So far I've seen two options, in many threads, that look promising: Ener-G egg replacer and replacing eggs with flax. However, not a single use case I've seen here is about bread. I'm looking for an option to replace 1-3 eggs in a bread dough with: 500 g of white wheat flour, 200 ml of milk, 50-80 g of butter, a variable amount of sugar (5-50 g) and 20-30 g of fresh yeast.  Examples of this dough are the , the  and a similar recipe from Galicia (northwest Spain) with even more eggs. And so many other breads, but these are my favorite ones :)  Has anyone tried flax or ener-g on a similar bread dough? How to find web hosting that meets my requirements? This is a "catch-all" question designed to serve as an answer for all questions about choosing web hosting.  Pro Webmasters no longer accepts new questions about how to choose hosting.  All future questions pertaining to finding web hosting should be closed as a duplicate of this question. For more information about this policy please see .    How to find web hosting that meets my requirements?  What we're looking for in answers to this question are the basics about web hosting:   What is web hosting? What is the difference between shared, VPS, and dedicated hosting? How does a content delivery network relate to web hosting? Anything else you feel is helpful in finding a web host.   What we do not want is:   Endorsements or recommendations for specific web hosts We do not want your experience or other subjective information (just the facts please) Multi-window: prevent the out-of-focus app from pausing? Prove $\sin^2\theta + \cos^2\theta = 1$ How do you prove the following trigonometric identity: $$ \sin^2\theta+\cos^2\theta=1$$  I'm curious to know of the different ways of proving this depending on different characterizations of sine and cosine. Limited options in a certain area? Ok so i am a bit of a noob in blender, so I need help with this.  I am trying to texture something, but there is no texture button where there should be, because the blender edge window cuts it off here's a picture How to select the nth row in a SQL database table? Are there any rules for adjudicating a ranged attack fired at a target engaged in melee combat with an ally? While running a session recently, one of the players chose to "assist" his companion who was in melee with a goblin, by firing an arrow at the pair of them. I couldn't find any particular rules for this scenario so just had him roll at a disadvantage, counting a miss as a hit on his companion (damage to be ascertained by a second roll).   This seemed to work okay, and became a running joke for the night as the arrow bounced off the companions back, but are there specific rules for this scenario? Probability of complete coupon set in $K$ boxes where a box has $N$ distinct coupons? Lighter in CPU/Memory Usage: Lubuntu or Xubuntu I am looking for an Ubuntu version that consumes less Memory and CPU. I have read both Lubuntu and Xubuntu (The homepages, wikipedia, phoronix and other sites comparing both). But from experience, which one uses less memory and is less CPU intensive. I need to install them in very old hardware and want to persuade the owner of the hardware of the benefits of Ubuntu.  in this case I want to install 11.10 or 12.04 when it comes out. How are each behaving in those versions?  The 2 PCs I will be installing either Xubuntu or Lubuntu are:  Granpa PC:  CPU - Pentium 2 450Mhz RAM - 64MB DIMM Video - 16MB Used for - Documents and Internet. No listening to music, no looking at videos. Just using it for document writing.  The other old meat:  CPU - Pentium 3 550Mhz RAM - 128MB DIMM Video - 16MB Used for - Documents and Internet also but they want.. or maybe they are wishing for it to use it to see movies and listen to music. This one has internet. The other one does not.  UPDATE  Wanted to update this question with the test results for over 8 months worth of using Lubuntu and Xubuntu. When it comes to very old hardware, am talking about 64 MB, 128 MB or even 256 MB of RAM computers, Lubuntu is better than Xubuntu when comparing Memory usage. When it comes to CPU usage, both are the same.  This will not improve I/O Disk performance which will be the bottleneck for old computers. Also the difference in performance between Xubuntu and Lubuntu is about 10% to 20% percent in memory usage. Again, CPU usage is the same.  Now, when it comes to how responsive the Desktop is, LXDE (Lubuntu) has a much better response time than XFCE (Xubuntu). I would say about 50% or just simply noticeable to the eye. Lubuntu is similar to how Windows XP looks while Xubuntu is more like how Gnome 2 looked.  The computers (The old ones mentioned here) and 2 more are still working in excellent conditions thanks to the Ubuntu family. I also want to add I am using 13.10 for both distros. Hypernym for "clients", "members" and "partners" It started happening today... all of a sudden, no apparent reason!  Here's the output from df:   assp:~# df -k Filesystem           1K-blocks      Used Available Use% Mounted on /dev/simfs             6291456   1378384   4913072  22% / tmpfs                  8202680         0   8202680   0% /lib/init/rw tmpfs                  8202680         0   8202680   0% /dev/shm  assp:~# df -i Filesystem            Inodes   IUsed   IFree IUse% Mounted on /dev/simfs           55781934   83005 55698929    1% / tmpfs                2050670       2 2050668    1% /lib/init/rw tmpfs                2050670       1 2050669    1% /dev/shm  assp:~# df -h Filesystem            Size  Used Avail Use% Mounted on /dev/simfs            6.0G  1.4G  4.7G  22% / tmpfs                 7.9G     0  7.9G   0% /lib/init/rw tmpfs                 7.9G     0  7.9G   0% /dev/shm   Here's an actual entry from /var/log/mail.warn:   Dec 11 17:55:37 assp postfix/smtpd[30614]: warning: not enough free space in mail queue: 0 bytes &lt; 1.5*message size limit Dec 11 17:55:37 assp postfix/cleanup[30617]: warning: 4361D850D54: write queue file: No space left on device   .