[SOLVED] Making a door open when I am near it and hit a particular Key

question
#1

Hi Folks:

IM new to armory, and I am working on Architectural Visualization projects. I am trying to achieve what I think would be a simple procedure, but I cannot seem to find the docs or a tutorial about it.

What I want to do is set up a door so that when I hit the space bar, it opens, stays open for a specified length of time (lets say 3 seconds) and then closes again. I was able to do this in BGE, but I’m having a hard time translating that to ARMORY.

Long term, I’d like to be able to have a detection zone around the door so that it only opens when I am within the detection zone.

Please note that my “character” is a camera, as there is no per se character b/c it is always first person.

I could really use some pointers on how to do this or an example setup to work from. I tried to look at the tanks demo, but when I set up my door the same way, nothing happens

Thanks
TIM

0 Likes

#2

With nodes you can do this by setting a distance. I cover the idea in my latest Module - you can find the video here: https://youtu.be/Rj86ShaJI9U and here : https://youtu.be/kteztWPVaUI
And the module here: https://gum.co/tracking

opening the door can be done with set rotation node and the sleep node with give you the pause you are looking for.

Hope that helps

3 Likes

#3

Hey @Tim_Holmes
So you already saw the fairly simple file I posted on DIscord, but I thought you might like to see a way of doing this that works for multiple doors that animates the doors.

To be honest, it would probably be simpler logic-wise to use an animated action for the door opening and closing. It would probably also animate the doors smoother. I didn’t want to get into the learning curve of that when you’re starting out though, so this has all of the logic visible in one door logic tree.

It works by keeping a property on each door item which records how open the door is. When the door detects the camera close and the door isn’t fully open, it opens it a bit each frame. If the door detects the camera isn’t close and the door isn’t fully closed, it closes a bit each frame.

You can move the camera with the arrow keys (animation would be smoother using a different method, but there you go).

door automatic.2.blend (1.0 MB)

3 Likes

#4

Hi all – ive come back to this issue after a break to resolve others.

In the above thread, the door automatic.2.blend file works as it should – door opens and closes as I come near. however as demonstrated in my game file

3-20-2019 - Stripped out materials.blend (3.8 MB)

the doors pop open when the file is executed, and do not ever close – can you please help me debug this – im available on discord as well

thanks in advance

TIM

0 Likes