Hi Guys.
I hope you can help me a little further .
I 'm currently make a little minigame where i must set the “distance” in the x and y axis in the Inspector of the object .
I want be an script for a object so that the other object should emulate and i want to select the x and y axis distance in the Inspector.
And it should be possible to choose the mimic in the inspector .
I Hope you can help me .
Thank you so much.
What do you mean the other object must emulate? I don’t get what you want, can you please elaborate?
errr… well, I think I understand the problem.
Your main GameObject already contains the x,y axis exposed in the inspector through the Transform component (transform.position).
Your “mimic” GameObject should have a script attached to it with a public field such as:
public Transform ObjectToMimic
Then in the inspector, click and drag your main GameObject into the publicly exposed slot in the inspector for your mimic GameObject
Then, in the rest of the code in your mimic’s script, simply reference the x/y of your main GameObject like so:
ObjectToMimic.position.x;
ObjectToMimic.position.y;