Getting a character to move to a location after basic animation setup -bones

So I’ve read a chapter in the Game development book, and I took a look at an example file.

I don’t get it. It mentions an empty being the leader, so that the AI example will travel to it. So I want the animated person to walk to a certain point.

What I’m not sure about is, the animation is the center of all of that, so how the character moves is same where ever?

I am not sure but it can’t be work only with an animation setup that not animated to the point or/and with an constrain to follow some thing

but I would realized it with an tracking actuator to that point.

A simple click and follow for you.
mzFollowClick.blend (91.6 KB)

That is interesting, but that won’t work with the character I have. I would want the character to move around on it’s own. I mean may be that could work for a robot, as that is an assistant to a person.

So press key and robot with animated treads follows with some sound effect or something. That may be a useful example for that, I would think. :confused::cool:

Attachments


you can realize it with some ray sensors if something in the way he will run around this if some one near (with an near sensor) he will track to this person with an track actuator

And using that file I can add those extras for lets say the robot to follow?

Change the ‘path marker’ to your ‘player’/‘character’ to follow.

What is the mzlogic python? Where do I obtain this code if that is what it is?

Attachments


Hi. Everything is inside that .blend file, you can reach it using ‘text editor’ mode.

Hmm, I tried opening and finding it, it isn’t there.

I’m not sure if I understand you.

A typical scenario is:

  • have an invisible physics object that interacts with the environment (e.g. fall on ground).
  • have one or more visible objects that represents the figure.

The physics box moves, the visible meshes just imitate as if they are walking (they are not the cause but the result).

This reduces the motion to the physics.

You could use the steering actuator to find a path to any target object and follow this path.

I don’t know how to do anything that is my point.

The book I have explains AI for fish movement, but that doesn’t really help me with getting an AI character to move.

In my Demo, I’m not bothered about AI character movement, only for the robot.

The player is a first person angle view, which is quite rubbish at the moment!

As I tried to at least get the bricks setup, there is no cube.001 which is the player. So I can at least try the example posted.

Attachments


Try this. Uses arrow key.
mzFollowCursor.blend (90.5 KB)

I won’t need an arrow key for the movement of the robot.

from bge import logic
#cont = bge.logic.getCurrentController()
#sens = cont.sensors[“Mouse”]
#over = sens.position

def setTarget():
cont = logic.getCurrentController()
if cont.sensors[‘MouseLeft’].positive:
pos = cont.sensors[‘MouseOver’].hitPosition
PathMarker = logic.getCurrentScene().objects[‘PathMarker’]
PathMarker.worldPosition = pos

Don’t look at the arrow key or mouse click (placement for marker).
Things that you might need for your robot is the blue turtle ‘logic brick’ to follow the marker (red pyramid).

I saved that code as text file in the file. But the red thing is the cube.001? With left mouse click for the robot to follow cube.001 which is the FP camera.

Attachments


Copy the ‘red marker’ and parent it to your player/character/that guy. Remove the red marker ‘logic brick’.
Create logic brick for the robot similar to the blue turtle (‘Cube’) logic brick.
The robot should follow him.

Do I need to use the code?

I renamed the cube.001 to player, it doesn’t display in that menu for ‘Action’?

I added an empty parented to the robot. So it should follow the ‘player’

Attachments




Hi.

I suggest you make a simple small scene first to get your logic right - it is also easier for other people to assist - you can share the file here.

The code you’ve copied are made to control the mouse logic.

The ‘Action’ should be your character ‘Action’ (Animation - walk cycle).

Thanks.