TrackTo problem.

Hi.
TrackTo supposed to force an object to look at the direction of another. Am I wrong?
If I am wrong can someone tell me if this is possible to be done right now in BGE and what supposed TrackTo to do? I just get the objects disapear.

A description of what “exactly” you want to happen, and a .blend please.

I wand the camera to look at an object.

Can’t you use the camera actuator?

Depending on what you are doing, you can also parent a camera to the player.

I wand to make some rotations and mathimatics are going to complex if I wand to have the camera face the object. Here is the .blend with my problem.
RapidShare link : http://rapidshare.com/files/10003844/TrackToProb.blend.html

Your .blend crashes blender on my machine, weird.

Hope someone can help you out.

Sorry.

Strange. You can see the problem. The steps I created are simple. From the start screne clear rotation and location to the camera. Then raise it so the cube can be visible from the camera. TrackTo the camera to the cube. Run and see the cube disapear. But I believe that camera takes an infinity position or something like that… here is a .blend with a console that prints the orientation matrix of the camera…
RapidShare link : http://rapidshare.com/files/10003844/TrackToProb.blend.html

This is a strange problem, but it seems to be happening because of where the camera is. When I moved the camera off to the side so that it was not pointing directly at the cube, track to worked fine. I would suggest avoiding starting the camera looking directly at the object. Give it some actual tracking to do, and it should work fine. Also, you used an Always sensor which fires a continuous pulse. The track to actuator only needs to be activated once and it will stick. Un-click the “Positive pulse mode” button on the Always sensor to make it fire only once at startup (and free up game speed).

For fun, make the Cube a Dynamic Actor, and watch it fall when the game runs. The camera tracks it nicely.

Edit: Just as a note, I think that the real problem is that the camera shares two location coordinates with the cube (the x and y coords for both are 0) which causes a bug in the trackto code. I tried leaving the camera where you had it and rotating a bit before running and still got the same problem. It would seem that the two objects can only have one coordinate in common at startup.

Yes the problem looks like as you saied Blendezo. If they share two coordinates then we have a problem. I am almost sure about the infinity thing. It’s a common problem when tou are using mathimatics. IEEE( Institute of Electrical and Electronics Engineers ) the reason that you are using EPISLON. Erwin knows about it and for sure he is using a way to bypass this problem in bullet. Looks like it is something they forgoted to check in trackTo.

wow!

this crashes my blender 2.42, and my 2.43 rc1.

I will boot into Linux and try from there.

I use winXp and I don’t have a crash. Strange I don’t understand why a crash take place?

yeah, i have a similar problem. when i try tracking it the camera doesnt move in the game but when i try looking away and then tracking, and i just see blue.

You will need to post a .blend for us to look at.