Hi all! I need some help with a simple LookAt script in Unity. I want just this rectangular cube to always point at a certain object. But it's not very easy for a new beginner. I'm quite experienced with graphics in Unity. Just not very good at scripting. And I need this for a job really bad. I started out by using this…
Sounds like a really good hint. The problem I'm experiencing may have something to do with preserved axis coordination from the import. The up vector should always be the same from Maya to Unity. Though maybe it can be helpful. I'm not that good at scripting though. Thanks for the answers :)
Thank you all for the answers :) It worked fine when I changed the name of the class to 'jointLookAt' and then the same for the script name. Because it's for rigging these bones and joints in different sorts of machines. The problem still is that it seem to point -90° at aside. Not directly towards the actually target.…
Interesting... I'm not still sure of what's the problem. Too bad I have lots of other assignments for my internship for the moment. Don't get very much time over for this specific task. I really hope I can solve the problem. I love making realtime graphics. It's just all this stuff about scripting and so on... But I thank…
Not sure exactly what the issue is in your case, however, I threw together a little debug info helper script today that should aid you in seeing what the axes are for your objects. This way you can see what is pointing at what. Get it here. The results look like this: Bright axes are local. Darker axes are world. Yellow is…
I see... I tried to apply the script and I changed the up vector some, and the others as well just to check what's happening. But every time I play the scene it looks the same either way. All object in the hierarchy are linked together. So there is a chain of parent/child relations all the way. Only I'm pretty insecure…
I'm currently working as an intern for a company in Gotheburg, Sweden. Much om my material is highly confidential. Though this specific model has already been published on the market. Maybe there is a way I can take some screenshots without getting in trouble... I always try to keep the pivot in local not global…
Did you try adjusting the up vector away from the default value to see how it changes the rotation axis? Just wanted to check that since the script was supposed to be an illustration of the concept rather than specifically solve your issue. Second: What is your hierarchy? Are the side piston bits separate objects? If so,…
Ah, I love Gotheburg. One of the few cities I've visited outside of the U.S. A really great city for touring around on foot. Lower buildings, and lots of great parks. Very pretty architecture. A more laid-back feel compared to Stockholm. As to Unity, you are going to want to keep your transformations in local space. You…
From what I recall the "lookat" always points the "forward" axis toward the object being looked at. This is its +z axis. (since unity is a Y = up system) Also of note what I just found out, the axis of your OBJECT is preserved on import, even if it is pointing the right way in the scene. This may be overruled in…