Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] Still Having Problems With Opening Cabinets
Author Message
Strembitsky Offline
Member

Posts: 243
Joined: Feb 2012
Reputation: 3
Post: #1
[SOLVED] Still Having Problems With Opening Cabinets
I have gotten the cabinet to close once inside. I then want it to open. When I use this code:
AddPropForce("cabinet_nice_1", -1000, -1000, -1000, "World");

The doors only twitch a little bit, and don't stay open. I have disabled the door auto-close, and I have made sure nothing is blocking it on the other side. Can someone please help?
(This post was last modified: 02-07-2012 03:53 PM by Strembitsky.)
02-07-2012 03:55 AM
Find all posts by this user Quote this message in a reply
flamez3 Offline
Posting Freak

Posts: 1,320
Joined: Apr 2011
Reputation: 57
Post: #2
RE: Still Having Problems With Opening Cabinets
Use "world" instead of "World", you are pushing them too hard. Make it like 10 or something.

You could set another cabinet active that has the door's open. Up to you.

02-07-2012 04:50 AM
Find all posts by this user Quote this message in a reply
Ninami Offline
Member

Posts: 59
Joined: Feb 2012
Reputation: 2
Post: #3
RE: Still Having Problems With Opening Cabinets
And remember to double check that a "-" sign is needed in order to open the cabinet. I had that problem before, I tried to open a cabinet with force, I used -10 but in my world, a -10 would force my cabinet the wrong way, so I just changed it to 10 and it worked.
02-07-2012 05:40 AM
Find all posts by this user Quote this message in a reply
palistov Offline
Posting Freak

Posts: 1,175
Joined: Mar 2011
Reputation: 56
Post: #4
RE: Still Having Problems With Opening Cabinets
When you use AddPropForce it applies the force to the entire object as a whole. The cabinet is static aside from the doors, so using AddPropForce won't work the way you want. Instead, you'll want to use these two functions. Instead of applying the force to the whole prop, it applies it to specific bodies, in this case the two cabinet doors.

PHP Code: (Select All)
AddBodyImpulse("cabinet_nice_1_Body_1"fXfYfZ"World");
AddBodyImpulse("cabinet_nice_1_Body_2"fXfYfZ"World"); 

As usual, make sure you tweak the X, Y and Z forces until the cabinet doors open the way you want them to.

02-07-2012 07:18 AM
Find all posts by this user Quote this message in a reply
Strembitsky Offline
Member

Posts: 243
Joined: Feb 2012
Reputation: 3
Post: #5
RE: Still Having Problems With Opening Cabinets
I don't have access to my editor now, but the above seems like it'll work, so for now the thread will be solved. Thanks a lot! Have some rep.
02-07-2012 03:52 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)