Getting the character object to activate with some bricks?


So I now have my wonky robot moving and on the floor, but not facing the FP.

Having messed about with sound, keys, and some small animation.

Just how can I use a ‘near’ brick to activate my object so it works only after that, and then I can press another key to work with a different audio sample.


WHEN near -> set other state (that performs your “works” operation.

I’m going to need a bit more information. So at the moment, I can press a couple of keys and the robot works with audio. What really should happen is a key would need to be press so that the others can get it moving and talking.

I’m not seeing what exactly you want to achieve. I have a very vague idea. I can’t give specific advice on that.

How would you describe to a user what he can do with the robot?
What keys cause what operation?
When should these keys work and when should they do nothing (or something else)?

All I want to do is exactly as cotax’s example does. But for some reason my variation which is exactly the same as Cotax’s with the exception of the fact that the object I am using isn’t a cube. Yet all the properties are the same.

So it should work?

The only difference was with mine was I didn’t make the Player property a Float, where as he did for his.

Sorry but that does not help me a bit. I still do not know what you want nor what you did nor what could be wrong.

@modelinblender, you need to explain the problem better if you want help. You seem to be trying to hack something together from what other people give you without really understanding what you’re doing, and that will only lead to more problems down the road.

Take note of Monster’s questions. The’ill help to get a clear idea of the problem and how to approach it. Forget about the problem code you have right now, because it’s getting in the way. Start by outlining how you perceive the game should work from the user’s perspective, NOT from a coding perspective. THEN list the steps that you think the game should take to achieve that goal. From that. you should be able to get some clarity of how to go about coding it.


Right as seen in the image there are bricks that get my object to move to the FP. That is all it simply is suppose to do, though with that a simple on/off switch would be a nice addition. So there are two audio sounds for it, once the robot has been switched on, and a second once it moves to the FP. Cotax’s example is the magic!

But the first problem is that I press the F key which is the follow key, it doesn’t follow the player, using cotax’s example which was fine. Some adding to it would be necessary for a robot activation.

Could that alone be written in python by somebody? So to avoid the brick setup for that alone? Or is that pointless. I can’t program the computer in any language so that is out of the question for me for the moment.

But with the bricks it should possible to switch on the robot, so that the F key will work, without turning the robot on the F key won’t make it work.

So you want the object to move to the character’s position when a key is pressed?

Just add a key sensor and hook it up to a add/set state actuator, and in that other state have the “following” logic, its that simple.

Yes, which it did originally, but cotax’s example does that, when I replicate his example it doesn’t do so.

And when it did follow the FP it just started moving in and out, so stuck in the player area.

I created an example, press up/down arrow to move and space bar to toggle following. I would suggest that you try to play around with it, see the logic bricks and all the options they have, test them and see what they do. At this stage that is pretty much the only way you can learn stuff properly, also if cotax’s example doesn’t work when you replicate it, it just means that you yourself are doing something wrong and try to figure it out.

Here is the file:

Note: I am using states, if you are not familiar with them, look it up.

I tried you’re file, that is similar to oldguy’s file, I only want the robot to move to the FP with the press of a key, not continuiously.

I repeated Cotax’s example on the object as well as on the cube parented on the object due to the fact the robot kept falling through the floor. Of course one or the other, regardless of where ever the bricks are setup with a game property for both the FP and object.

I think this might be the one:

Use the mouse and WASD to move around
When you press spacebar the cube moves to your location and doesn’t keep following you unless you press spacebar again.

I tried you’re example on my file, without using a state, that is okay? And it does work.

Sadly the object keeps sinking into the floor, and I had used a cube for the motion, bricks.

I did setup a state system, so here it is.

If I press the F key it just moves a little, but doesn’t travel to the FP at a distance.


Just use the states as in my example, it moves a little because as soon as you release the key it sends a false signal and deactivates the steering actuator.

The sinking is probably a collision bounds problem and I cant really help you unless you provide a file.

Well according to you’re example, it is exactly like that?

I’ve got the object in a file with the bricks.

Ok now please listen carefully, when someone gives you a file, you should analyze it properly before saying anything. NO, you hadn’t used states as I had in my example, you just simply winged it hoping for it to work right. You realllly should start learning the basics of logic before getting into this stuff.

I took a look at your file and you hadn’t setup the states properly at all even though I told you to just use the states as I had, and you still said it was exactly like my file, it wasn’t at all.

The falling through the floor was a collision problem I fixed it to some extent, try the file and PLEASE!! look at all the things thoroughly before copying and saying its not working. Look at how the states work and everything.
HERE is the file.

I repeated the steps, and I made sure the collision box was geometry location, makes no difference which one, the object still flys away once the engine has started unless I lock it X,Y, Z.

The difference between the one I sent was that originally the head was parented, you had joined in that example file. I joined the one in my file, as well there are two pieces of the object that aren’t joined. Does that in anyway affect the object overall?