Need help with opening door

(Robbert Scholten) #1

I have been making this game, and a part of it is the player can open a gate with a coin. I tried to create using game logic but it doesnt seem to work

These are the sensor and actuator setups for both objects. Invisible object is ment to be an area the player has to be in to open the gate by pressing E He can only do this when he has 1 coin. (adding the coin setup later) so now its supposed to open when the player is in the area and presses E, but it doesnt. All the actuators attached on their own do work (Like when it only has to press E or only has to be in that area) but attached together like in the screenshot it doesnt.

0 Likes

(blenderaptor) #2

before investigating further … i see that you send the message to the object “TESSSRR” and not the “DOOR” object

0 Likes

(blenderaptor) #3

also, dont forget that a message is just an instant . Are you expecting to press “E” exactly same frame than when the message comes to DOOR ?

0 Likes

(Robbert Scholten) #4

i renamed the TESRR object as door for this screenshot, so thats not the problem :slight_smile:

0 Likes

(Robbert Scholten) #5

i tried it with the tap function on on the message sensor, still no result.

0 Likes

(blenderaptor) #6

i suggest this solution :

SENSOR

  • when collision --> and --> property actuator on a string you create ( ‘locked’ to ‘openable’ )
    DOOR
  • if “E” + Propriety == “openable” -> and -> animation open door
0 Likes

(Robbert Scholten) #7

I have recreated an new test, now the key sensor and collision sensor are working together, but now i cant seem to get a third sensor to work, one that says the player has to have one coin.

Again, i have hooked up the one sensor on its own and it works fine when i get a coin

0 Likes

(Robbert Scholten) #8

Im sorry, im pretty new to the blender game engine, im not sure how to do your solution

0 Likes

(blenderaptor) #9

Messages are used to instant pulse , they dont remain true (as far as i remember) Proprieties are the things which remain

0 Likes

(blenderaptor) #10

you can upload your file. I will do it for you if you want

0 Likes

(Robbert Scholten) #11

So i was testing some more and i got it to work!, i used the propierties to be an sensor for the opengate message!. Thanks for your help!

0 Likes

(blenderaptor) #12

0 Likes

(blenderaptor) #13

you dont even need to have a sensor box … your gate can have a collision box setted to static and ghost

0 Likes