How to set parent to components object?
I want to create a new gameObject and set its parent to the scripts object. I have tried "gameObject.transform.parent = this.transform" and other variations and the object does not show up at all or does not properly set the child to the scripts object.
Answer by FortisVenaliter · Oct 05, 2017 at 07:19 PM
The code you showed has always done the trick for me. If that doesn't work, you need to include more detail, as surrounding code must un-set it or something.
Your answer
Follow this Question
Related Questions
Animating parent scale changes the child initial position? 0 Answers
Getting Parent GameObject from Child? 1 Answer
Cant get setParent to actually set the parent for child. 0 Answers
Sprite changes the child local position,Sprite pivot change Vector3.zero postion of child gameObject 1 Answer
PlayerControlled movement of child of moving object 1 Answer