Is This AI?

Isoprog 101 Nov 05, 2009 at 14:08

Hi there,
I am making a game where the main character will drive a car. It is a 3rd person camera. Lets say, when the character is near a car and player will press the use key ( e.g. “E”), the main character will open the car’s door and sit on the drivers sit ( than the character will become child of the car node and, the control will switch from character control to car control, this is not my problem). My problem is, how to let the caracter know that where is the door and he will go and open the driver sides door?

In simple words, if the character is inside the trigger area of the car and player press the use key, how the character will know that where is the door of the car?

Here is what I want to tell u:


Thanks for ur reply,

4 Replies

Please log in or register to post a reply.

starstutter 101 Nov 05, 2009 at 14:32

honestly that part should be fairly easy too. The more sphisticated way to do it would be to have an area defined as the space where the car door can be used, and then have a point defined where the door handle is. When the player presses the Use key, he can turn towards the door handle so that his animated hand will grab onto it and open it. Since this is 3rd person, it doesn’t have to be perfect, just close enough so that he doesn’t grab solid metal and open the door. If you’re going to have different cars of different sizes, you might need to make several animations of opening car doors that adjust to these different hieghts off the ground.

Isoprog 101 Nov 05, 2009 at 14:45

Ya, but it is the second step, the first step is, wherever the character is(inside trigger area), he will hv to come near the door by itself. That mean as soon as the use key will be pressed, the character will go to the driver’s side door by itself. The control will become something like self control(character node), not keyboard control(human).
BTW, thnks for reply

Reedbeta 167 Nov 05, 2009 at 17:21

Have a point parented to the car that represents where the character should be standing to play his “open door” animation, and path the character to that point, using whatever usual obstacle-avoidance system you have for characters walking around.

Isoprog 101 Nov 05, 2009 at 18:30

Ya, got it. thnks Reedbeta. When, starstutter said animation, was thinking about an animation sequence.