Basic Game Logic Question

Ok so I have a controllable player who can “pick up” the torus object which is my key. Only if I am carrying this key will I be able to go through the gate. I guess I am confused on how I should send messages to other objects using property’s like haveKey equals 0 or 1 for true or false.



firstlevel_test.blend (686 KB)

You could try assigning a boolean to the object
Then assign a property actuator(Copy Mode) to the object reacting to the key
If object has key (true) then door object copies property when object with key (touch or radar sensor triggered) is close
thus allowing action tied to a true property to kick off
Thats what I would try first.

How do you do copy mode? Would it be much trouble for you to download it and show me by doing it?

Well if you use a property actuator on the door click in the mode box and choose “copy” then choose the object to copy from (probaly player) and its property to copy( probaly boolean with a true = has key, false = no key). Then assign a property sensor to the door and set it to equal and set logic to work with result.

still not seeing the copy option


That is a property sensor. You want to use a property actuator. Actuators are the last logic brick in sequence.

Ok now I got it. Thanks for being patient

Hm still cant get it… Any chance you could show me how you would do it and upload it?

Yeah lme see what I can whip up

Got it done. Need to upload this file.

Uploader is sucking. I can email you a finished file if you want.

okay heres a break down

I took your key object and changed it to a static mesh and unchecked the ghost option.
The key will delete itself if it collides with an object with a “player” variable.

I gave your player 2 boolean variables. “player” and “hasKey” “player” is for collision checks
“hasKey” is for collision with key, stores true if collision occurred

I gave your gate a boolean. “key” I used a near sensor to detect the “player” property which inturn copied the “hasKey” to the “key” property.
I used a property sensor to check if “key” was true and if it was play an animation of your gate going down.

I deleted all the logic you had except your move logic for the player.

Ok I pmed my email, thanks again