2
$\begingroup$

There I have added the door. How do I add the door handle?In the game engine, I've created a door handle and door, and am trying to combine the physics in the logic editor so that when I left click on the door handle, it spins, meanwhile also swinging open the door at 120 degrees. To summarize my problem, when I select two objects, I can't get both under logic editor, and they end up having the same qualities. How do I separate them?

$\endgroup$
  • $\begingroup$ Could you explain closer, what you mean with "they have the same qualities"? Usually it shouldn't be a prolem to handle multiple objects with the same logic bricks. $\endgroup$ – Quacksilber Apr 30 '18 at 16:38
  • $\begingroup$ @Quacksilber Ok, well I am having a problem with handling multiple objects within the same logic editor tab. What action do I need to choose to make the handle spin and what action do I need to make the door swing without a hinge? $\endgroup$ – user55674 May 1 '18 at 14:42
  • $\begingroup$ Are the door and the handle rigged? $\endgroup$ – Quacksilber May 1 '18 at 14:58
  • $\begingroup$ Do I need to work with the sensor for the objects in the physics column? $\endgroup$ – user55674 May 7 '18 at 15:11
  • $\begingroup$ No, you can use any sensor on any object you like. It depends on how you would like to open the door. By standing near the door, and pressing a key? By klicking with the mouse on the handle? Or something else? $\endgroup$ – Quacksilber May 10 '18 at 13:39
1
$\begingroup$

What your final result may look like:

enter image description here


You can link the logic-bricks of different objects if you select both of these objects in the 3d-view.

enter image description here

In my example, I use a mouse-over and a left-button sensor to detect a click on the handle. That goes to an and-controller, which is connected to both the armature of the door and the armature of the handle. Both armatures then play their animation.

|improve this answer|||||
$\endgroup$
1
$\begingroup$

Inter-object connections are possible, but make your logic bricks really complex.

I assume you do not need very short reaction time on the mouse click. Therefore I suggest to communicate via messages. As additional benefit you can have any number of different door openers. (Button press, mouse click, joystick button, automatic door opener ...)

Sensing when to open the door

The sole purpose of this logic is to send a message whenever the door should be opened. To differentiate the message from other message you set a meaningful subject such as "open door". Be aware when you have more than one door you should tell what door to open: "open door A" vs "open door B".

Example:

on door handle (of door A)

Sensor Mouse over Sensor Mouse left button Controller AND Actuator Message subject "open door A"

Opening the door

Your door and you handle or door A should both listen to a message "open door A".

handle: Sensor Message subject "open door A" Controller AND Actuator Action ->play handle turning action.

door wing: Sensor Message subject "open door A" Controller AND Actuator Action -> play wing opening action.

Both receive the message at the same time. This results in playing both actions at the same time. I guess this is what you want.

|improve this answer|||||
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy