I am facing this problem in Unity again and again. I cannot find solution. I think my code is right, but where is the problem?
GameObject visual = Instantiate<GameObject>(placementObject[num], hit.point + visualOffset, Quaternion.identity);
visual.transform.SetParent(parentObject.transform); <--- Causing error
Any suggestions? Thank you for any feedback!