I'm instantiating a girl and a dog using the following code
Instantiate (girl1, Vector3(47,177,8),rotation);
Instantiate (dog1, Vector3(47,177,2.5),rotation);
I now want the girl and dog to follow a 'ball' object as the moves, but can't work out how to use code to make the girl and dog into children of the ball.
Not sure whether I should be doing this in the same line as the Instantiation, or on a seperate line once instantiated, but either way I've tried a few things but can't work out what the code should be.
What would I need to add to the above to get the girl tofollow the 'ball'?
Can anyone help please?
thanks for that. I'm still playing with it, but at the moment this is giving me the following error: "Setting the parent of a transform which resides in a prefab is disabled to prevent data corruption".
– anon65134473Sorry! I mistyped your answer. It does exactly what I requested. Thank you very much. Greatly appreciated.
– anon65134473