void Update () {
if (Input.GetKeyDown(“q”)) {
GameObject wepon = Instantiate(Gun) as GameObject;
wepon.transform.parent = player.transform;
wepon.transform.position = new Vector3(0.37F, -0.3F, 0.5F);
this kinda work, but setting the position does not! it doesn error out, instead it just spawns somewhere else…
Where does it position it? Check the values, what are they? Are they different from the ones that you specify?
– instruct9rMy answer is awaiting moderation. Here, try this: wepon.transform.localPosition = new Vector3(0.37F, -0.3F, 0.5F); or wepon.transform.position = new Vector3(0.37F, -0.3F, 0.5F) + player.position;
– dumytruncps: it's a weapon ;)
– Bunny83Either way keep up the excellent quality writing.
– FoolishTroll