Keyboard commands for mesh objects - what about a sensor?

Hi,

I would prefer to activate a door with a key but only when the FP player is in front to trigger a door to open.

How do I go about that?

I have also purchased a copy of the Game Development book by Mike Pan on Amazon UK for reference, £17.50 like 22 Euros. I had wanted to purchase via the Blender shop but I wasn’t able to do so. More of a Thanks to Ton and his team for the software.

Connect the keyboard sensor and a near sensor to sense the player both to an and controller that will open the door

I tried connecting these logic bricks.

Obviously they don’t work.

Attachments


Erm, that involves a code script for this to work then.

yeah, I can provide it, but it’s much better if you learn how yourself,

it opens up many more possibilities.

in the video I introduce casting a ray using python, only when you need it.

you may be able to use logic to trigger the button

collision with property------and---------toggle prop and set timer

You probably didn’t add a camera property.

door.blend (463 KB)

I’m not knowledgeable of any computer programming language, in 2013 I used a little of Visual Basic, but I don’t remember any of the code, I do have a print out on paper, and may be a backup in a notepad file. It was for Windows mobile 2002. A game, 2D Asteroids, it doesn’t even work properly, once the asteroids have been missed, the program must be closed for it to work all over again. LOL!

Thanks for posting that clip. But I don’t feel, that is a step for me just yet.

What I like to do is have an invisible collision box in front of my character’s point of view. When the door touches it and a button is pressed, the door opens. That way, I know the player is looking at the door and wants to interact with it. I’ll whip up my logic bricks in a moment…

EDIT: Gosh darn it… now it’s not working for me. I’ll get back to this comment once I have time to figure it out. Sorry about that.

izok Lush, that sounds like a valid method,

here is mine using a raycast :smiley:

Q = cast ray to try and detect door button,

(does not use any resources per door barely as there are no collision sensors or near sensors in each door)

Attachments

ModularDoorAsset.blend (510 KB)

I have viewed the door blend, what I don’t understand about it is, on the door itself, that object, how does it work.

I viewed the cube object that just moves forward with “w” and “f” to open a revolving door.

Attachments


ok right now, if you used flipper the door should remain open as long as you send the message,

and alternative would be to use a property based animation,
or a bool.

like

if Open is True-----and-------play animation(open door)

if Open is False—and---------play animation(close door)

if message-------and------------toggle Boolean Open
if actorNear----/

When it is about doors, you can have a look at

Door Control

and on top of it

How to: create a door preset

I’m aiming for sliding doors.

Attachments


Just a matter of your animation. You can create any door. The control is the same ;).

ModelInBlender - There is no substitute for playing / tinkering / investigating inside a engine…

Tutorials are nice, but they won’t get you as far as setting a goal and tinkering / testing / tutorials(only when stuck until you achieve your goal.

I don’t understand the whole process. I’m starting to think that I’m not very good with exploring avenues.

Ok, step 1

make a actor cube actor run around

step 2 = make a cube actor add a object in front of him using a empty you parent to the actor

step 3 = make the object you add invisible and ghost and give it a property

step 4 = make another object that is a sensor set to detect that property

Step 5 = make the other object send a message when you hit it with the object with the property

Take it slow, go one step at a time.

I will help you :smiley:

Why would I want to make a cube ? I’m using a camera for this. I don’t have a character for my map.

the cube will be your actors physics bound, you add a rigged actor to the center of the cube (no collision) and parent him to the physics hit box then mark the actor invisible

watch this - (it gets more advanced as it goes**)