- Home /
Follow and Instantiated Object
Ok, so I am creating a climbing sequence and I need the player, when near a location, to follow an object over the predetermined wall, while animations are playing. Simple, right? Well mater of factly, no. I am using prefabs and don't want to ruin the prefab connection so I can't traditionally attach GameObjects in the inspector. So here is my question; how do I instantiate and follow a GameObject using Resources.Load (only way I could put resources/data into the game with out the inspector.)
Thanks a lot guys, I know I am asking for a lot, but this is bothering me.
By the way I am using c#.
I'm not sure if i understand you correctly, but you might want to look at Object.Instantiate
Well, I find it weird that Resources.Load is the only way you have of creating objects in your scene (I almost always use Instantiate to make instances of a prefab), but I guess your player has a target or objectToFollow reference.You can just set that reference in the same code that creates the instance of the new object.