Q: character to stop at a wall, without physics engine?

I am making a test walk around hit stuff game and I want my character (currently the cube) but I don’t want to use any physics, just animations and stuff. I have some fences, and I want the cube to stop when it gets to the fences, and not go through them. I don’t know how. Here’s a screen showing what I need.

http://img451.imageshack.us/img451/7601/screenshot0el.jpg

Again, just to clarify.

I don’t want to use physics (for collision with walls and stuff) and want to make it so the cube doesn’t go through the fence. Thanks to anyone who helps!

Maybe learning python would help. A gratuitous use of ray sensors might work, but who wants to do THAT?

I do know basic python, but I don’t know how I would do this. Would you somehow tell the character to move back a little bit along the Y Axis when it collides with the wall, and then stop moving until something changes. NVM, I was kinda talking to myself, but anyways, if anyone would know how to do this, drop a line.

Why don’t you want to use physics? That’s what blender is set up for. Without it, you would have to use geometry, trigonometry, and python. It would be slow and doesn’t make sense. There are two types of physics in Blender. The sumo is really very simple and mostly collision and gravity. If your dead set against using physics, then the easiest thing to do is to align the fence along the x axis. That way you can just test if the character is below a certain y value and if he’s not, put him at the edge of the fence.

The collision sensor is physics as well. But your idea is right. Just stop the forward motion when the collison sensor triggers.

I tried it and half got it working and half didn’t. The half that is working is the front half. I have it set up that (without physics) when the cube collides with the wall, it will take a small step backwards. Then if you’re still holding the forward arrow down, it’ll do it all over again. It works surprisingly good! The only other part I need to work on is if you back into the wall. It’ll stop you if you’re going forward, but if you’re going backwards, you can ghost right through it! LOOL! Anyway, back to work!

Try using Blender builtin physics, BUT use the “Sumo” engine instead of the “Bullet” one. Sumo was built exactly for this kind of simplified situation. It will still do the collision detection, etc, but will produce much simpler kind of motion - no rolling, etc.

If you read the initial post you would have known that he “does not” want to use any physics engine, just a script (a logic brick system can be set up too, but I think that a python script would be much more efficient).

Because there are bugs in the physics engine maybe?

Either way I believe that there are some benefits to using just scripts that fake “physics engine like” behavior, rather than the physics engine, like having more controll over “everything” that happens in your game. Also the physics engines that blender is using now (sumo, and especially bullet) don’t seem all that reliable. Sumo isn’t advanced enough and there are loads of complaints (bugs) on the Bullet engine.

If you read the initial post you would have known that he “does not” want to use any physics engine, just a script (a logic brick system can be set up too, but I think that a python script would be much more efficient).

Because there are bugs in the physics engine maybe?

Either way I believe that there are some benefits to using just scripts that fake “physics engine like” behavior, rather than the physics engine, like having more controll over “everything” that happens in your game. Also the physics engines that blender is using now (sumo, and especially bullet) don’t seem all that reliable. Sumo isn’t advanced enough and there are loads of complaints (bugs) on the Bullet engine.[/quote]

I guess the great problem is because this engines are inside blender (integrated to it). But this problem is also a great solution if you don’t have programing skills. If i want small libraries maybe it is better to work outside Blender isn’t it?. Because if i insist to work inside Blender using script metods it means that i still facing some high level issues… One of them Blender’s interface itself, “P” to play etc etc. In fact the problem is not Sumo or Bullet or X, the problem is how Blender stablish a dialog with that libraries…