#Dont judge me.....

15 messages · Page 1 of 1 (latest)

barren goblet
#

Do you understand what Object reference not set to an instance of an object means?

serene glade
#

Yes, that here isnt any value...

#

I think

#

But I did set it up

barren goblet
#

What do you think you "set up", and where do you think you did so?

#

Or, asked another way:
What variable do you think is missing its value?
And can you point me to the line that gives that variable a value?

serene glade
#

I have Vector3 vektor = nwe Vector(0,0,i), if i undestand it well ,the (0,0,i) is the vule here

barren goblet
#

That is not the case.

serene glade
#

But this value changes everytime for loop starts again

#

so it can be this

#

*cant

barren goblet
#

First of all, Vector3 is a value type. Those cannot be null in the first place.
Second, the error comes from the line vertices[i] += vektor;, and right-hand operators of assignments (which vektor is here) will never cause a NullReferenceException.

serene glade
#

yes, all this i know

barren goblet
#

Your problem (most likely) is, that vertices is null.
Arrays are reference types - which can be null, and you are not initializing the array anywhere.

serene glade
#

yes i had to be blind, thank you for your help