- Home /
How Can I Set Object Position to Another Object?
I want to set my swords position to my characters hand. How can i do this? Please help.
And this is my first question. I'm amateur on this.
Do you want to do this via script? Does your character have joints? The sword is inside the scene or is a prefab? We need more information to help you.
If you are a beginner, I recommend that you follow some tutorials
https://unity3d.com/learn/tutorials/modules
specifically, you'll need to learn how to code so I'd go through the scripting the tutorials before you try to do your own thing
https://unity3d.com/learn/tutorials/modules/beginner/scripting
Answer by Lachee1 · Jun 12, 2015 at 05:53 AM
Hmmm, this is a really simple question and maybe you should watch some more tutorials, but here you go anyways ;)
Will move objectA to objectB (C#)
public Transform objectA;
public Transform objectB;
void Start() {
//Make ObjectA's position match objectB
objectA.position = objectB.position;
//Now parent the object so it is always there
objectA.parent = objectB;
}
Thanks :) i watch to many tutorials but my english is not good :D and no body makes unity tutorial for my language
Your answer
![](https://koobas.hobune.stream/wayback/20220613200858im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to segment a number line of game objects between two points dynamically? 1 Answer
Object's sprite and collider are not at same position as transform 1 Answer
gameobject generates sometimes on previous position 1 Answer
GameObject.find and positioning 1 Answer
Compare Position of two gameobjects and if true, do nothing, help me please! 1 Answer