Hello!
I am creating a graph using Debug.Drawline. What i want to do is add additional gameobjects to the existing array.
This is my script:
public GameObject point;
public GameObject[] points;
void Start () {
//First line
for (int i = 0; i < 11; i++){
x = i;
y = Random.Range(0f,1f);
points *= Instantiate(point,new Vector3 (x,y,0),transform.rotation) as GameObject;*
-
}*
- }*
The new gameobjects should be placed at x = 0.5, 1.0, 1.5…
for the y coordinate the first new gameobjects should be placed at:
if (points*.tranform.position.y > points[i+1].tranform.position.y)*
new object.transform.position.y = points_.tranform.position.y - abs(points*.tranform.position.y-points[i+1].tranform.position.y)
else
new object.transform.position.y = points.tranform.position.y + abs(points.tranform.position.y-points[i+1].tranform.position.y)
^is easy, what i cant understand is how to put these new objects in points array.
I made a picture below:
[60023-unityhelp.png*|60023]*
*
All help is appretiated!
Thank you!
/Taegos_