I have a game object sitting in the level I am currently creating and when the player gets near it I instantiate a prefab at the same location. I want to have the original GameObject attach to the instance so I do this:
orginalGameObject.Transform.Parent = instantiatedGameObject.Transform
but I get an error telling me that parenting to an instance is not allowed to prevent data corruption.
Is there a way I can do this? I want the original GameObject to be attached to that it can be dragged away by it. The instantiated GameObject is also a RigidBody which is jointed using a spring joint, just in case this should make any difference.
Thanks for the help.