Hello, everyone I’m trying this code
public GameObject group;
public GameObject spriteofobject;
void Start(){
int sekilKareSayi;
var rotation = transform.rotation = new Quaternion(0.0f, 0.0f, 0.0f, 0.0f);
for (sekilKareSayi = 1; sekilKareSayi == 1; sekilKareSayi++)
{
var position = transform.position = new Vector3(gameObject.transform.position.x, gameObject.transform.position.y, 0.0f);
var create = Instantiate(spriteofobject, position, rotation);
create.transform.parent = group.transform;
for (sekilKareSayi = 1; sekilKareSayi <= 3; sekilKareSayi++)
{
var position1 = transform.position = new Vector3(gameObject.transform.position.x, gameObject.transform.position.y - 0.320f, 0.0f);
var create1 = Instantiate(spriteofobject, position1, rotation);
create1.transform.parent = group.transform;
}
}
}
but it’s not creating ‘create’ and ‘create1’ as a child of parent ‘group’ object