- Home /
how to let two game objects share the same world coordinations?
I have two separated (no child) game objects on the same location but they don't share the same transform. I think it was because I imported one form another scene. How did this happend and how can u let all game objects in the scene share the same world transform coordinations. Thanks in advance.
A transform is an instance, therefore they can never all share the same instance. However if you simply want them to be in the same place and rotation you can do this.
public void $$anonymous$$atchTransform(Transform source, Transform target, bool matchLocalScale = false)
{
target.position = source.position;
target.rotation = source.rotation;
if (matchLocalScale )
target.localScale = source.localScale;
}
Your answer
![](https://koobas.hobune.stream/wayback/20220612193638im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
This does not make sense this.gameObject.transform.Find() why? 2 Answers
Storing transforms from objects in Array 1 Answer
Correct way to spawn and move objects 1 Answer
How to Make a Transform Variable Target a Random GameObject? 1 Answer
Position gameObjects in circle around another gameObject 1 Answer