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

Sure, I used the mouse code and in the logic brick for the player it is left mouse click, what is wrong with that? It isn’t that important whether it is a mouse click or a key on the keyboard.

As for the scene, I just setup the same parts, a player, another object to move to the player and an empty. The player doesn’t load in the small menu, only Armature action and cube.002 action is what displays.

Player isn’t listed, is that because it isn’t set as something for it to be an action?

robotai script is updated to include player

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

That the robot won’t follow the player by using the mouse left button click. As well as that the player as I renamed it to from cube.001. doesn’t display in the Action brick only 'Armature, and cube.002. Now cube.002 is a sensor for another set of doors, storage doors.

So why doesn’t ‘player’ as a dynamic cube not display for the brick menu so that the robot can follow it?

Must the robot be a static object, or an actor?

I tried a video tutorial for version 2.62 via the video site youtube. Making the object a dynamic, and creating a steering brick for it. All it does is fall through the floor and travel at a race car’s speed to the computer’s memory.

So this quick tutorial doesn’t including pressing a key or left mouse button, but it would be a start to get an object to follower the player cube.

I’m sooo confused.

Is this a point and click game? Can’t help with that.

By “follow”, Do you want the robot to attack the Player, or something else?

In the video it’s showing how to set up a navmesh,

FWIW. I would put the zombie on states. (in the video above)
Because I wouldn’t want him to attack, until he saw me. I would either animate the zombie on state 1 to just wander aimlessly. Or. I would randomly move a target for him to track to until he saw me. Steering actuator “Target”
If he sees me, he switches to state 2, where he attacks the player steering actuator “Player”

I was having trouble with the navmesh, because I wasn’t resetting after going in edit mode to adjust it. Thank you John Hamilton.

If your having trouble with getting the navmesh to work, try, select navmesh, go to Physics > click " Navmesh reset index value"

Do you want the robot to follow your first person player (FP)? If so, how will you see the robot? It will be behind the FP camera? You want the robot along side the FP right?

Did you want the robot to stay near and do what the FP does? Like MR. Zircon in “ratchet and Clank”
Like Sparks the dragonfly in “Spyro the Dragon”?
Or do you want it to stay near the FP but still do it’s own thing, like Ellie in “The Last Of Us” or the old dude (can’t think of his name. Sully?) in “Uncharted”

Anyway, why couldn’t you just parent, the parent of your robot, to the parent of your FP? Then use the same input that moves your FP, to rotate the tracks. (You won’t need movement on your robot because it’s parented to your FP, and will move with it)

Forgive me if I totally misunderstand.

Hey there,

Thanks for responding. I appreciate you’re input there.

What I want to do, is get that robot with the press of a key to turn on, and then a sound is played, once that is done, the robot can remain idle. I then can press another key where it goes to follow the player.

That is it for now. As for the rotating treads, they aren’t parented or joined. Everything on the robot is joined with the exception of the transparent head part.

So the aim for the moment is just to get some basic movement. So I can parent one of the treads, and as for getting that moving, I don’t know. I have that sort of complicated example, and then there is an animated UV example, either which I don’t know how to get working.

I tried the reset, nothing.
[video]https://youtu.be/USp80YQ3m2s[/video]
This clip displays what is happening.

is normal that all become complex if you starts from the details.
the threads, uv, scrolling , animations of any sort sounds, are details.
make focus on the boxes .(maybe the boxes can have some mesh static parented to box
just to make more clear what is the box (player , robot , enemy )

one time you get the box that moves correctly (robot follow player when is pressed key etc)
do the details trying to not overcomplicate the boxes .

in the best cases the animators (if simple) not need to get command
from the box or have extra info from it (that are command and code anyway)

for example the robot can know alone if it move forward , and so play the right animation,
do some sound and other … detail…

in this way you can keep separated the LOGIC , that must be functional ,
and the “details” that make the game loock good.
details are matter , but try to keep it separate more as possible from the logic functional

Still confused.

Are we talking about animated (tank) treads?
Getting a robot to turn on, and follow the player?
Or getting a Navmesh to work?

IMHO animated texture on tank treads look worse of all to me, because there is no shadow play. A minor detail, but I can’t help you there.

OK, so you want the player to turn on the robot, play a sound, and have the robot follow the player, is that right? Simple, use states.

You can do it without a navmesh, but you’ll need some python to align the robot, to the same vector as the player. And place the robot at a location near the player. Use a keyboard sensor to set parent.
Parenting the robot to the player.
Then use distance constraints to keep the robot at a certain distance from the player. But you run the risk of having the robot get stuck on corners, or sharp turns.

Using a navmesh would be easier, as it will do the aligning for you.

Use states.

But you can’t get the navmesh working?

On the robots steering actuator,
Set the distance (relax distance) to keep the robot a certain distance from the player.
Make sure the player is the target.
Navmesh is correct one, if there’s more than one.
Make sure the steering actuator is set to pathfollow.
Make sure both player and robot are actors.

Set your states on the robots “and controller”, by clicking the plus sign to the left of the “and controller”. All those boxes on the “and controller” are states. (the top 30)
click the first box, that will be state 1,

Simple example;

State 1 (robot off)

keyboard whatever---------and------------state > set state 2 (click the box next to state 1)

State 2 (robot sound, armed & waiting to go)

Delay 1 (or always)------------and-----------------sound > play end (to play the sound all the way to the end)

keyboard whatever(can be the same key as above)---------and---------state 3 (click the box next to state 2)

state 3 (follow the player)
always------------and------------steering and whatever animation. (select both armature, and robot, interconnect robots “and controller”, to armatures action.)

Keyboard (can be the same)---------and-----------state 1 (to turn robot off)

something like that.

Your robot may still get stuck on the corners, I would use a octagonal collision box instead of rectangle or square. Helps a little.

Hope this wall of text helps

States, so essentially just add bricks to get the different events to take place.

State is in the ‘Actuator’ section of the brick editor.

With a box collision it just flew away, with a sphere it now drops through the floor, as well as with a convex hull, triangle mesh, capsule.

If I remove the settings from Steering, the numbers. Distance, velocity, Acceleration, turn speed. It moves slow away to the back of the 3D scene.

On the collision propery, if I change dynamic to character, blender closes.

It is an actor in the physics menu.

Attachments


does this help?

object follow on keypress.blend (467 KB)

space to (stop)follow the player, use up and down to move the player

If your robot and/or player fly away, they are set up wrong. Make everything “no collision” except the dynamic object that moves the char. I call it a collision box. But it’s probably called the “bounding box” not sure the proper term. Mesh should be parented to Armature making the Armature parent of mesh. the collision box is the armatures parent, and all the logic is on the collision box. Or check out Monster guide to setting up a character. Why is the always sensor inverted? why are all the layers active? Please re-read my post, I can’t dumb in down any more than that. Sorry.

I’ve selected the robot as no collision object, it doesn’t fly away now.

Cotax has got the example right to begin with. So a navmesh isn’t needed I would of thought with that example.

Hey there,

Thank you for posting that example, I think that is the ticket. I do need a key press so I can add audio so to activate the object.

With Cotax’s example, the robot faces in different directions once I press a key. If I turn on the collision for the robot, to dynamic with default box, it flys away.:confused:

As well with triangle meshl that falls through the floor, and stays there up to the head part of the robot. But it does follow to the player cube, and falls all the way to the 3D environment area.

The image displays it slightly falling, as this is only a screenshot.

The next certainly shows what I mean.

Attachments



https://www.dropbox.com/s/42l73rwhmo1kurt/example.blend?dl=0 Heres another example. I also have one with a navmesh but having trouble uploading to dropbox

I prefer more Cotax’s it looks more natural than having a slave robot follow the player everywhere. Thanks for trying.

I thought that was what you were going for. A slave robot. Oh well, I won’t bother to upload the othr Blend. Have fun, sorry I couldn’t help.

Cotax’s is fine, what doesn’t make sense is why the object falls through the floor. Only in one scene did the robot follow the crew members, and it was on remote control.

Having the robot follow the player with a lift going to an upper deck won’t make sense.

Since this is a demo, the robot has no use other than activation and sound.

I managed to increase the height of the robot to include the head part and neck sticking up to the top part of the robot using a collision setting. If I increase the setting to 1,000 it flys away. If I invert the bricks, the robot remains stationary with some rotation movement with the front facing opposition the FP.

A constraint won’t hold it there, I did had collision bricks too.

As for a switch on setting, I’m notsure.

Attachments


Well, by checking the Z Lock translation the object remains above the floor, it then goes towards the player going backwards, so it does a static turn facing the player to get there.

This clip displays the problem.https://www.youtube.com/watch?v=RBdHyBk7T3E

I’m notsure what is causing that.

The Margin scroll option was much higher before, too high and the object flys away, any other bound shape object, it flys away.:confused:

Attachments