i want to swap objects using instantiate.
im having trouble using instantiate, could someone help me with the code.
asked Jun 08 '10 at 12:11 PM
When you instantiate with just a prefab it'll appear at the location that you saved it in (could be anywhere). When you use transform.parent it changes the parenting of the object but it wont move to where the old object was.
What you need to do is instantiate the new object at the same transform.position (or alter it's position afterwards, which ever you prefer).
At the moment I'm assuming your old object gets destroyed and then you can't find the new object because it appeared else where.
Do something like this:
answered Jun 08 '10 at 01:22 PM