- Home /
Make an object do exactly what another, but later
Hi! I want to make a game, where an object - after touching - follows the actual player the exactly same way (with jumps, climbing, walking etc.). But because it FOLLOWS the maincharacter, it should be a bit later than it is actually played. I can not just give the following object the same positions as the maincharacter has, because f.e. the jumping should be happening at the same place with the same height, just later. So I don't know if therefore I have to store/record the information from transform.position of the maincharacter into an array an then, after a while, put this information into the transform.position from the following object. If so, how could I do that? Or is there simply a much easier way to do this? I'm using C# by the way. Thanks in advance!
I haven't implemented my follow script but the way I envisioned it would be that every few steps my player would drop an invisible gameObject which my follower would use for $$anonymous$$oveTo (if they aren't in combat). If the follower ever gets X steps behind in the chain it will automatically teleport to the nearest one the player just dropped. I saw someone on UA mention that and thought it sounded like a good approach
Thank you for your answer! I already found this: http://www.virtualgamelab.com/2/post/2010/07/demo-for-saving-dataeditor-scripting.html It is working and places spheres along the path of the player, if you load the recorded way. The problem is, I'm doing the game for an Iphone and therefore cannot save the data into a txt-file. I tried to adapt the script for my needs with storing it into lists, arrays and so on. But I wasn't able to adapt it for my needs so far.
Your answer

Follow this Question
Related Questions
(C#) Follow target (script) transform target PREFAB 0 Answers
How to have child object only follow parent x position 3 Answers
can i let the sphere follow a point(x.y. or.z) on plane? 1 Answer
Set Position and Rotation with another GameObject as Pivot (Script) 0 Answers
Update position of an object to match a high velocity object and still allow OnMouseOver() 1 Answer