# Creating an bone at a locators position

**URL:** https://forum.highend3d.com/t/creating-an-bone-at-a-locators-position/5702
**Category:** Maya
**Tags:** mel
**Created:** [November 11, 2002, 1:17am UTC](https://forum.highend3d.com/t/creating-an-bone-at-a-locators-position/5702 "2002-11-11T01:17:53Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![fred22](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/f/bbe5ce/32.png) [@fred22](https://forum.highend3d.com/u/fred22)
#### Post date: [November 11, 2002, 1:17am UTC](https://forum.highend3d.com/t/creating-an-bone-at-a-locators-position/5702/1 "2002-11-11T01:17:53Z")

</div>

Note: I already posted this on the Maya mailing list, but I thought I might get more specific answers in this forum thanks.

I'm new to mel I've done a little. But my problem is I'm trying to to create   
an object at another objects location specifically a bone at a locator.

I can't decipher the best way to apply the transform of the locator to the   
bone. Can I use a vector to pass the XYZ values to the bone? Or do I have to   
use an array(storing the xyz values as separate floats)? Because my first   
thought was to use an array of vectors, this was because I wanted to create   
multiple locators and then have the bones created in the at the respective   
positions. So I was going to store the locator positions in an array then   
create the bones based on how many locators were in the array.

I did some testing and I couldn't use a vector stored in a variable to   
create a sphere at the position of the vectors value. e.g.

vector $position = \<\>;  
sphere -p $position -r 1 -n posSphere;

Is this because X, Y, Z transforms are individual float values and not   
vectors? If so why?

Last question... I actually know how to gather these values separately but   
thought it rather silly to store them as separate variables in separate   
arrays and not as vectors in a single array. Can I gather transforms and   
store them as vectors? If so how?

Thanks for reading all the way through this I appreciate it alot.

Regards Matt

---

<div class="post-metadata">

### Author: ![warpcat](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/w/c89c15/32.png) [@warpcat](https://forum.highend3d.com/u/warpcat)
#### Post date: [November 11, 2002, 9:20pm UTC](https://forum.highend3d.com/t/creating-an-bone-at-a-locators-position/5702/2 "2002-11-11T21:20:57Z")

</div>

float $locPos[] = `xform -q -ws -t locator1`;  
joint -a -p $locPos[0] $locPos[1] $locPos[2];

presuming you have a locator called locator1....

---

<div class="post-metadata">

### Author: ![fred22](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/f/bbe5ce/32.png) [@fred22](https://forum.highend3d.com/u/fred22)
#### Post date: [November 13, 2002, 12:45am UTC](https://forum.highend3d.com/t/creating-an-bone-at-a-locators-position/5702/3 "2002-11-13T00:45:53Z")

</div>

Yes I found J schliefer's post on cgtalk regarding the same topic. I've learnt heaps there. But I'm still wondering about some of my other questions about variable types.
