I am rather new to Unity, but I’ve read some similar questions and altering the Z axis does not seem to make a difference.
I start with the green diamond button and a rover image in the top right canvas to show that it can be seen.
Then I click the button and the clones are instantiated, but I can’t see them.
Then if I can drag a clone in the hierarchy so that it is a child of the canvas then I can see it (but only in the bottom left corner)
Is there a way that the clones can be a child of the canvas immediately upon being instantiated?
Also I know that this has 4 clones being made evenly spaced apart, it was being used for cloning sprites and worked.
Thank you!
and sorry that this script looks so weird, I am not sure the best way to format this text here.
.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
public class Maketherover : MonoBehaviour
{
public UnityEvent buttonClick;
public Transform Rover;
void Awake()
{
if (buttonClick == null) { buttonClick = new UnityEvent(); }
}
void OnMouseDown()
{
for (int i = 0; i < 4; i++)
{
Instantiate(Rover, new Vector3(i * 3, -2, -2), Quaternion.identity);
}
}
}