Community
Maya Animation and Rigging
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya animation topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

making objects always facing the camera

17 REPLIES 17
Reply
Message 1 of 18
ID22OX22
5425 Views, 17 Replies

making objects always facing the camera

I'd like to know how to make objects always face the camera like how they do for grass in The Elder Scrolls Online. 

 

It'd be very useful for my environments. 

 

https://www.youtube.com/playlist?list=PLHTcD15rNxQrkEYr_6S-trciKNWCqF3HI

 

Please answer soon!

17 REPLIES 17
Message 2 of 18
osidedan
in reply to: ID22OX22

I'm not 100% sure on what you're trying to do, but you mentioned the grass, so I'm guessing you want it to  point at the camera if the camera moves left/right, but not if the camera goes up or down. To do so, you can use constraints and a locator:

 

1. first off, make sure you're in either the rigging or animation menu set:

menu_set.png

2. create a locator: (create>Locator)

3. in the outliner, select the camera you want everything to point at, then also select the locator you just made.

4. go to Constrain>point, and use these options. This will bind the locator to the camera's x/z position, but not the y(up/down)

point_constraint.png

5. Now select the locator you made, and also select an object that needs to point towards the camera.

6. go to constrain>aim with the following settings:

aim_constrain.png

 

repeat steps 5 and 6 on each object that needs to face the camera. 

 

Let me know if that works or not, you might have to change the aim vector of the aim constraint depending on what way your objects are oriented.

 

 

Message 3 of 18
toyyoda95
in reply to: osidedan

This didn't work for me at all. I did all the steps exactly like described, but literally nothing happened. Is there another way or something? 

Message 4 of 18
jmreinhart
in reply to: toyyoda95

Those steps are exactly correct. There are other ways to do it but they are more complicated, the above is the correct way to do it. Here is an example scene.

 

 

Message 5 of 18
toyyoda95
in reply to: jmreinhart

As I said I followed the steps exactly. I even made a test scene with nothing in it expressly to try to make this work, and a simple cube. I've tried it 6 times and I've looked at the example scene. Nothing makes it work. I'm moving the camera around in any direction and the cube isn't moving. Is there any other way to set it up using some other combination of constrain or aim or whatever? 

Message 6 of 18
toyyoda95
in reply to: jmreinhart

Also, about the example scene, it was no help because moving or editing the perspective camera doesn't cause the object to move or rotate at all, there are no other cameras in the scene, and the orthographic cameras can't rotate. So I'm not sure at all what you were trying to show there. That the constraints exist? They do in my scene too but I get the same result: no reaction and the face of the object not following my camera or viewpoint. 

Message 7 of 18
jmreinhart
in reply to: toyyoda95

I redownloaded the example file I sent to make sure nothing broke and it still works for me. The object rotates along the Y-axis so that it always faces the camera. You never see it as a flat sheet. Either it's breaking when you open it in Maya (I'm using 2018), or I'm misunderstanding what you want. I attached a video of the result

Message 8 of 18
toyyoda95
in reply to: jmreinhart

Yeah, that's what I want to do, but it doesn't happen in the scene you posted. I've tried it on 2 computers now, so it's not like my specific Maya version is corrupted or anything. I don't use outdated programs if I can help it, I have Maya 2019, not 2018, and I reinstalled it less than 6 months ago to make sure it was working properly. I don't get any error messages when opening or using your file, I just don't see any results in it or when I followed the instructions you posted. No errors or notifications or popups then either. 

Message 9 of 18
mcw0
in reply to: toyyoda95

Check your up axis

Message 10 of 18
toyyoda95
in reply to: mcw0

I did, it's up, no surprise there. But that's irrelevant. Even if left was up, it would still react, just in the wrong direction. Instead, NOTHING reacts. That's the problem. 

Message 11 of 18
mcw0
in reply to: toyyoda95

Might I suggest doing a simple test? Please create 2 locators. Now move one of the locators away on the z axis ( if your world is Y up) 10 units (or just input a value of 10 for translateZ. And let's call this "target". Now with "target" still selected, hold the shift key and select the other locator. Now create an aim constraint looking down the z axis.

 

Now test to see if everything is working by moving "target". If this is working, all you have to do is cancel out any rolling effects by disconnecting rotateZ from the constraint and setting rotateZ to zero.

 

If this works for this simple test, then apply the same steps to your actual scene.

 

Good luck

Message 12 of 18
toyyoda95
in reply to: mcw0

Hi, 

I've done this over and over and over again and none of it works, and it's completely useless. I don't have 6 weeks to try to do this even more ways with no results and people repeating the same broken information, so I'm just looking for a different way to do it. But after trying every single suggestion here and not getting to work a single time in my file OR the example file posted, I'm just making a blanket statement that none of this was a solution to the problem or a usable answer to the original question. I appreciate the time and effort put into responses but going in circles isn't helping me so I'm just going to look for an alternate method.

Message 13 of 18
mcw0
in reply to: toyyoda95

I'm so sorry this isn't working for you.  Something is terribly wrong if the simple case didn't work.  But let's see if we can give you another option.  If you are comfortable with joints and ik handles, might I suggest using that?  Create a joint with a start position and an end position.  Then create a single chain ik handle.  Now do a point constraint of that handle to your camera.  You will need to disable the X axis of your joint so that it doesn't roll.  I'm assuming that roll is undesirable.  Then parent whatever you want to that joint.  Hope this works for you.  But if a simple aim constraint doesn't work, you might want to reinstall Maya.  Something very strange is going on.

Message 14 of 18
mcw0
in reply to: mcw0

Another option is to use a motion path.  Seems each option gets more complicated.  Aim constraint was the simplest but since that didn't work for you, maybe the joint idea or this will.  Create a linear curve with starting point at the position of the object that you want to face the camera.  Place the end point anywhere.  Now create a locator and pointConstrain the locator to the camera but skip the Y axis (assuming you are Y up).  Now connect the locator's world position to the curve's controlPoints[1] attribute.  This will allow the locator to drive the end point of your linear curve.  Now create another locator and put that on a motion path using the linear curve as the path curve.  Make sure to check "follow" so that the locator orients along the curve.  Now this locator should "aim" at your camera.  If this works, then just parent the object to the locator.

Message 15 of 18
toyyoda95
in reply to: mcw0

Aim constraint does work on its own. I'm trying to work out some issues with it but this thread said I should be using point + locator + aim constraint with specific settings and THAT doesn't work at all. Then whichever constraint used in the example file (I forget) didn't work or react at all. And none of the suggestions (which was mostly repeating "well it should work" every time it didn't) helped. I ended up asking a friend who suggested a basic aim constraint and a few other things and those have been working, but nothing in this thread did. I just didn't want the thread marked as "solution" or "resolved" because it wasn't, but I can't and don't want to use a ton of paths and rotation locks and complicated things because I do need to animate the camera and have it move around (which is entirely why I needed the things to face it). But my maya isn't broken; I've had broken programs before, including older versions of maya, and I've seen bugs and crashes and error messages and software issues. I have none of those problems at the moment. And I did look at the example file as well as try the original suggested settings on a second computer with the same results (aka, none) so it wasn't my specific copy of the program either. I'm using 2019, too, so it's not like I have a horribly outdated version lacking certain functionality or ability. Thanks. 

Message 16 of 18
mcw0
in reply to: toyyoda95

That's good to hear that aim constraints do work because that's all you need.  You just need to break the connection on the axis that creates the roll...assuming that roll is undesirable.

Message 17 of 18
toyyoda95
in reply to: mcw0

I'm not getting any rolling, since aim doesn't mimic rotation, it's just that aim isn't always working correctly. I made a post about it here if you're interested: https://forums.autodesk.com/t5/maya-animation-and-rigging/aim-constraint-breaks-half-the-time/m-p/95...

I'm not sure if it's some setting I'm missing or some random obscure issue. 

Message 18 of 18
Anonymous
in reply to: osidedan

that is great .. worked 100% ... but i want to add some points
1 -before " Aim constraint " you should.. "Freeze transformation " the object
2 - " aim victor " keep it as default " X=1 Y =0 Z=0 "
3 - " constraint axes " only Y axes
thanks for sharing information it was helpful for me .

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report