|
Hi!
I'm trying out the Unity engine (www.unity3d.com) to test out some small ideas - but I keep running into simple problems. I need a helping hand when it happens . Is anyone experienced in Unity and ready to take a newbie under his wings?
I'm pretty experienced Java, so the programming part shouldn't be the biggest problem.
-Qzy.
|
What aspect of Unity is giving you problems? And what language are you writing scripts in?
|
I think I'll write it in javascript?
Right now I have problems with the "LookAt" method:
http://www.jonnielsen.net/WebPlayer.html
The turret should aim at the worm, not go crazy .
The script is super simple:
var LookAtTarget:Transform; function Update () { transform.LookAt(LookAtTarget); }
|
Okay first of all I'm by no means an expert at Unity, nor am I a good programmer. But I've had a bit of experience using Unity before so I'll just post what I know...
I've never actually used the LookAt function prior to this, but I just tried it out real quick in Unity and I managed to get a similar looking turret to aim at a player-controlled cube using the exact same script you posted.
So I doubt it's a problem with that script itself. I'm not sure how your worm works, but I'm guessing it's from a Unity tutorial of some sort (since it looks familiar to me)? My guess is that it has something to do with the worm itself because I'm not sure how it's working or your turret's transforms aren't right or something. What are you setting the LookAtTarget variable to? Perhaps the turret isn't pointing at what it should be? What puzzles me the most is that the turret is translating as well, even though it should just be rotating... Like it's got the wrong center of rotation or something.
I guess the only point that I'm able to put forth right now is to double check and make sure everything's been set correctly, although I'm sure you've done that already lol
|
Awesome, I'm soon going to learn this in my classes too. Not to hijack your thread but is there a place where you can learn for people starting out with this program? Good Websites? Pre-req's I should have?
|
I solved the problem . The turret were placed at bad positions inside an empty game object - so it did move around, but around an invisible point in space.
|
On June 14 2011 03:23 XDawn wrote: Awesome, I'm soon going to learn this in my classes too. Not to hijack your thread but is there a place where you can learn for people starting out with this program? Good Websites? Pre-req's I should have?
Try youtube "Tornado Twins".. They got some tutorials up. . If you want to share some ideas, you can get my msn or skype.
|
The webplayer now shows the new game With turret looking at worm - and worm able to shoot by pressing space.
|
On June 14 2011 03:23 XDawn wrote: Awesome, I'm soon going to learn this in my classes too. Not to hijack your thread but is there a place where you can learn for people starting out with this program? Good Websites? Pre-req's I should have?
Unity's site has a bunch of useful tutorials, although some are a little bit too advanced, esp. for beginners. This site here was really helpful to me when I first started:
http://www.unity3dstudent.com/
Has a bunch of tutorial videos (under "Modules") that teach the basic stuff! Probably'll take you at most a couple of hours to go through all of them, and you'll definitely get a good idea of Unity once you do.
On June 14 2011 03:50 Qzy wrote:I solved the problem . The turret were placed at bad positions inside an empty game object - so it did move around, but around an invisible point in space.
I figured just as much, the center of rotation seemed out of place. But I didn't bring up the possibility of an empty game object, simply because I didn't think a simple sphere + cylinder combination of a turret would have any reason to be in an empty game object in the first place. Good on ya then!
|
On June 14 2011 03:23 XDawn wrote: I figured just as much, the center of rotation seemed out of place. But I didn't bring up the possibility of an empty game object, simply because I didn't think a simple sphere + cylinder combination of a turret would have any reason to be in an empty game object in the first place. Good on ya then!
The reason for putting it in an empty object, is to only have 1 script (LookAt) on one object, in stead of two . How much have you been playing around with unity? I would love to poke you with a stick when I run into more problems .
|
On June 14 2011 04:26 Qzy wrote:Show nested quote +On June 14 2011 03:23 XDawn wrote: I figured just as much, the center of rotation seemed out of place. But I didn't bring up the possibility of an empty game object, simply because I didn't think a simple sphere + cylinder combination of a turret would have any reason to be in an empty game object in the first place. Good on ya then! The reason for putting it in an empty object, is to only have 1 script (LookAt) on one object, in stead of two . How much have you been playing around with unity? I would love to poke you with a stick when I run into more problems .
I don't think you'd need to use an empty game object for that. Supposing your "turret" consists of a sphere object and cylinder object like I think it does, you'd just need to attach the script to the sphere, and then parent the cylinder to the sphere by dragging the cylinder object in the project hierarchy into the sphere object. The cylinder should follow the sphere's transformations exactly as long as you positioned it correctly I think.
I've only used Unity (using Javascript) for about half a year for a couple of uni projects that weren't too complex, so if you run into a simple problem, I'd probably be able to help. If it's a bit more involved, though... No guarantees lol. I'm not the best programmer out there and the Unity projects I worked on were pretty simple and took a pretty-brute force approach if I might add. So I'm probably still unaware of how a lot of Unity's functions work.
Regardless, Unity's a pretty fun tool to work with, and I wish you GLHF!
|
Thanks and thanks for the offer .
|
Thanks - I'll PM you for MSN or Skype sooner or later Hope all worked out for you too
|
Hmmm... Think I can use this for architecture(Uni major) modeling and whatnot. I have some experience in Java, not an expert but I think it shouldnt be too difficult.
Any input?
edit: Its only for fun, something to represent productivity until my summer work is over and class resumes again.
|
Yeah I'm using it show off artificial intelligence projects.
Currently implementing some of the latest AI .
|
|
|
|