Noob Question: Opening a Door Based on a Score Value

I have an empty that stores the points my character has earned. It holds a property called ‘points’. When ‘points’ reaches a value of 5, I want a door to open to let him into another room. (Ya, I’ve gotten really far in this game already. /s)

How do I send a message for the door to open?

I tried using a property sensor on the empty to watch ‘points’ and send the message ‘open!’ to the door when it equals 5. I put a message sensor on the door to trigger a motion actuator when it receives that message. But nothing happens so I’m doing something wrong.

Any help?

this a simple setup that does what you are trying to do.
the logic is on both the text object and the door.
opendoor-on-message.blend (530.2 KB)

I’ve been trying to use your example (which works fine), but I can’t get it to trigger the door to open in my own file. My set-up is slightly different because I’m using an empty that will carry the property that counts the points, and the count is added by targets when they get hit by bullet and their life ends. When the count gets to 5, the empty sends a message to the door to activate it.

I’ll keep playing with it for a while, and if I can’t get something working I’ll post my blend. I’m just trying out the same set-up in 2.79 right now to see if there’s a difference.

I think you should do this setup:
When the points in your empty is equal to 5, it will turn a bollean property to ‘true’, and when the player is near the door, the door will open, here is the logic bricks setup:

For the empty which counts the points:
Sensor:Property ‘point’ is equal to 5
And controller
Actuator : Message - open

Logic bricks for the door: ( add a bolean property ‘door’ to your door)
P
1st set of logic bricks:
Sensor:1. Message - open
And controller
Actuator- set property ‘door’ to true

2nd set of logic bricks: ( for the door)
Sensor : Propert ‘door’ is equal to true
And controller
Actuator : play animation of door opening

Hope it helps

I appreciate the help. I got the set-up I was using to work easy enough in Blender 2.79, but not in 2.9. If I could figure out how to see the debug information I could probably get it working. Any idea?

the debug options is located here in UPBGE 0.3

1 Like

Thanks! I should have seen that. Now I can see that my empty isn’t updating the counter when it gets a message to do so. Not sure why, because it works in 2.79.