Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] Still Having Problems With Opening Cabinets
Strembitsky Offline
Senior Member

Posts: 254
Threads: 37
Joined: Feb 2012
Reputation: 3
#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
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#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
Ninami Offline
Member

Posts: 59
Threads: 6
Joined: Feb 2012
Reputation: 2
#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
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#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
Strembitsky Offline
Senior Member

Posts: 254
Threads: 37
Joined: Feb 2012
Reputation: 3
#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




Users browsing this thread: 1 Guest(s)