# Aim Constraint (6)

**URL:** https://forum.highend3d.com/t/aim-constraint-6/43420
**Category:** Maya
**Tags:** new-user
**Created:** [November 19, 2005, 8:49pm UTC](https://forum.highend3d.com/t/aim-constraint-6/43420 "2005-11-19T20:49:08Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![mousemat](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/m/9f8e36/32.png) [@mousemat](https://forum.highend3d.com/u/mousemat)
#### Post date: [November 19, 2005, 8:49pm UTC](https://forum.highend3d.com/t/aim-constraint-6/43420/1 "2005-11-19T20:49:08Z")

</div>

Hi All,

I am having a problem and was wondering if anyone can help. I have returned to Maya after a long absence and am going over the basics from scratch.

I have an object and am constraining a spotlight at it. As soon as I apply the constraint the light rotates 180 in Y and almost 25 in Z. Need less to say this is not the direction it should be. Any advice as to why this is happening and how best to over come the problem.

Thanks in advance,  
mousemat

---

<div class="post-metadata">

### Author: ![joojaa](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/j/5daacb/32.png) [@joojaa](https://forum.highend3d.com/u/joojaa)
#### Post date: [November 19, 2005, 9:52pm UTC](https://forum.highend3d.com/t/aim-constraint-6/43420/2 "2005-11-19T21:52:28Z")

</div>

aim vector ia pointing teh worng way around! Se aim needs information on WHAT to aim too just saying aim sint enough imageine the computer beinga acaveman... giving hima a gun does not make him aim it correctly without teelling him what to aim where. likewise you need to tell whats considered up along theis axis too!

Should be ovious tough whan you look at the settings.

---

<div class="post-metadata">

### Author: ![joojaa](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/j/5daacb/32.png) [@joojaa](https://forum.highend3d.com/u/joojaa)
#### Post date: [November 19, 2005, 9:55pm UTC](https://forum.highend3d.com/t/aim-constraint-6/43420/3 "2005-11-19T21:55:41Z")

</div>

Ps dont doublepost!

---

<div class="post-metadata">

### Author: ![mousemat](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/m/9f8e36/32.png) [@mousemat](https://forum.highend3d.com/u/mousemat)
#### Post date: [November 19, 2005, 9:58pm UTC](https://forum.highend3d.com/t/aim-constraint-6/43420/4 "2005-11-19T21:58:11Z")

</div>

QUOTE(Joojaa @ 11/19/05, 01:52 PM)  
aim vector ia pointing teh worng way around! Se aim needs information on WHAT to aim too just saying aim sint enough imageine the computer beinga&nbsp; acaveman... giving hima a gun does not make him aim it correctly without teelling him what to aim where. likewise you need to tell whats considered up along theis axis too!  
Should be ovious tough whan you look at the settings.  
[snapback]220194[/snapback]

As I said, Joojaa, I constrained the light at the object so is ought to be pointing at the object no matter where the object is placed.

mousemat

---

<div class="post-metadata">

### Author: ![joojaa](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/j/5daacb/32.png) [@joojaa](https://forum.highend3d.com/u/joojaa)
#### Post date: [November 19, 2005, 11:02pm UTC](https://forum.highend3d.com/t/aim-constraint-6/43420/5 "2005-11-19T23:02:58Z")

</div>

Well tehts what you think... think again (aiming is not taht easy, but youve probebly never figured taht conciously out since you did figure out this as a kid 1 year old, compueters didnt). how did you define the constraint aand what it is it aims for? What do you need for a aim.

Aim consists of 4 thibgs not 2! what to turn, where to turn to, what direction that defines the aim axis, what direction that defies the Up along of the aim axis.

Its a fundamental truth the fact taht humans dont think about it does not eman tehy work thatway.

Example (paste into emptyscene):

CODE  
file -f -new;  
defaultSpotLight(1, 1,1,1, 0, 40, 0, 0, 0, 0,0,0, 1);  
move -r 0 0 -2;  
spaceLocator -p 0 0 0;  
select -tgl spotLight1;  
aimConstraint -offset 0 0 0  
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-weight 1   
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//NOTE THEESE VECTORS!  
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-aimVector 1 0 0   
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-upVector 0 1 0   
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-worldUpType "vector"   
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-worldUpVector 0 1 0;

defaultSpotLight(1, 1,1,1, 0, 40, 0, 0, 0, 0,0,0, 1);  
move -r 0 -2 -2;  
spaceLocator -p 0 -2 0;  
select -tgl spotLight2;  
aimConstraint -offset 0 0 0  
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-weight 1   
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//right vector wrong point  
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-aimVector 0 0 -1   
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-upVector 0 1 0   
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-worldUpType "vector"   
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-worldUpVector 0 1 0;

defaultSpotLight(1, 1,1,1, 0, 40, 0, 0, 0, 0,0,0, 1);  
move -r 0 2 -2;  
spaceLocator -p 0 0 0;  
move -r 0 2 0; // lets move teh piot too!  
select -tgl spotLight3;  
aimConstraint -offset 0 0 0  
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-weight 1   
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//right vector  
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-aimVector 0 0 -1   
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-upVector 0 1 0   
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-worldUpType "vector"   
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-worldUpVector 0 1 0;

---

<div class="post-metadata">

### Author: ![joojaa](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/j/5daacb/32.png) [@joojaa](https://forum.highend3d.com/u/joojaa)
#### Post date: [November 19, 2005, 11:18pm UTC](https://forum.highend3d.com/t/aim-constraint-6/43420/6 "2005-11-19T23:18:37Z")

</div>

PS pople dont be supprised if the right answer is something unexpected. Thats why you couldt solve it yourself since you failed to considear all the sides.
