Hi Friends,
I am getting error
!CompareApproximately (det, 1.0F, .005f)
UnityEngine.Transform:LookAt(Vector3)
Regards,
vanhouten777.
Hi Friends,
I am getting error
!CompareApproximately (det, 1.0F, .005f)
UnityEngine.Transform:LookAt(Vector3)
Regards,
vanhouten777.
I guess that the resulting Vector of
transform.position - lookAtVector
has a smaller magnitude than 0.005f
Not sure about that, but you should verify your parameters.
Dear Marrk,
Thank you for the reply. What is meaning of “det”, the first parameter?
Regards,
vanhouten777.
This would be the value which should be compared wether its near 1.0f or not. Not sure what will the value represents outside this method.
Hi Marrrk,
some other error
NullReferenceException: Object reference not set to an instance of an object
UnityEngine.Vector3.Set (Single new_x, Single new_y, Single new_z) (at C:/BuildAgent/work/14194e8ce88cdf47/Runtime/ExportGenerated/Editor/Math.cs:226)
ScriptName.Start () (at Assets/Scripts/ScriptName.js:3576)
Regards,
vanhouten777.
Something is null. Hard to tell you more without the actual code.
I have a two dimensional array like var abcd[,] : scriptname;
I create the array like abcd = new [20,8888];
But it is still giving null exception.
Regards,
vanhouten777.
Sure, you reserve space to contain the ferences but you did not create or assign any instances and put these into the slots.
Think of it as a stack of directories, they contain nothing until you put something into it. Your case here is that your directories are all empty → null
Hi Marrk,
so after this abcd = new classname[20,8888];
what do we do?
Regards,
vanhouten777.
That depends on what you’re using the array for.
For example: if you wanted to store the position of every GameObject tagged with “Box” you could do something like this
//Create a temporary array to store all the objects the find objects function returns
GameObject[ ] temp = GameObjects.FindObjectsWithTag(“Box”);
//Iterate through the temporary array and store the values into a permanent array
for (int i = 0; i < temp.Length; i++)
{
boxPositions = temp*.transform.position;*
}
This code is inefficient and should be done in the Start() function instead of every Update because Find functions take a lot of processing power, especially if you have 20,888 boxes. That said, I don’t know what you’re actually using your array for since you haven’t really specified.