Forum begins after the advertisement:

Save Soil

The Save Soil Movement

Poor farming practices and policies across the world have led to the degradation of agricultural soils in the world. This has led to the loss of nutritional value in our food over the years, and it will affect our food production capabilities in the coming decades.

Learn more about Save Soil →


[Part 8] Null Reference Exception issues

  • 31 August 2023: We recently fixed a bug where our Patrons were not getting their titles displayed properly on their posts.

Home Forums Video Game Tutorial Series Creating a Farming RPG in Unity [Part 8] Null Reference Exception issues

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #11569
    Jonathan Teo
    Moderator

    Null ReferenceException: Object reference not set to an instance of an object in RegrowableHarvestBehavior with ‘parentCrop.Regrow();’
    Do a Debug.Log of parentCrop after the line with the error, you should find that the parentCrop object is null. That is what the NullReferenceException is highlighting.

    You can check if the parentCrop is destroyed or missing on the Inspector as you are playing your game in the editor.

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.

Go to Login Page →


Advertisement below: