//UPDATE: The level posted below takes place in a subtractive level. It can be pasted into an additive level, but you need to give it a CSG base first.
Tired of animating a door to open and close in Matinee when a player touches a trigger? Wish your player could take a little more ownership over their door opening? Want no longer, here’s some instructions on making a dynamic physics door.
Add your door asset as a RigidBodyActor
Add a RB_HingeActor
Select your RB_HingeActor and click the “lock” button in the top right-hand corner of the properties window
Select your door asset
Click the green arrow next to “Constraint Actor 1”. This tells the RB_HingeActor to constrain your door
The picture below shows what settings go where, the settings outlined below are the same.
When you set Swing 1LimitAngle a green hemisphere will form around the middle of the RB_HingeActor. This shows the range of motion of your asset. Since all Actors in Unreal have a direction, you may need to rotate your RB_HingeActor so its range of motion matches the desired effect.
Your door will pivot based on where you put your RB_HingeActor. Be careful not to put it too far away or your door will look rather odd indeed.
Source code is below the picture for the sample level.
/this section tells the RB_HingeActor which kActor it acts upon
Constraint Actor 1 = The kActor in question
//this section sets its range of motion
Swing 1Limit Angle = 90
Swing Limited = TRUE
Twist Limit Angle = FALSE
Twist Limited = TRUE
//this section prevents it from moving around
Linear Limit Stiffness = 100
Linear XSetup
-b Limited = TRUE
Linear YSetup
-b Limited = TRUE
Linear ZSetup
-b Limited = TRUE
Pop open this level in UDK for a demonstration:
10 replies on “kActor Physics Doors – UDK”
I’m constructing a very large map, terrain, day/night cycle, bump and nonbump doors, and, Kactors so far. My trouble is it will NOT let me add a suitable Kactor to a hinge constraint. I make a new level with just a place to stand and a door with the hinge and it works perfectly. Are there anything that conflicts with the hinge constraint cause I’ve tried putting the Kactor in const 1 and const 2 slots and it keeps saying “Failed to assign KActor’nameofmymap.TheWorld:PersistentLevel.KActor_79′ to the Contraint Actor 2 (or 1) property, see log for details.” I go check the log and all I get is.
Cmd: ACTOR ADD CLASS=RB_HingeActor
Log: Attempting to add actor of class ‘RB_HingeActor’ to level at -190512.50,-28256.10,2328.66
Log: Actor Factory created S_HU_Deco_SM_Chainlink02_B
Cmd: EDCALLBACK SELECTEDPROPS
Log: Deleted 1 Actors (0.650 secs)
Cmd: EDCALLBACK SELECTEDPROPS
I cannot figure this one out. Any help would be much appreciated. Thanks.
Make sure the actor you’re assigning to the hinge has “PHYS_Interpolating” turned on in the Movement dropdown. Alternately, you can right-click on it and convert it to a Mover.
Suggest only putting the Kactor in the first const slot. Leave the other one empty (means that it is constrained with regard to the world)… There are 2 free videos on this constraints, one from 3DBuzz and the other on the UDN.
I hope this helps!
So far it works fine when I am firing a weapon at the door, but if I want the player to push through the door it will not budge. Any ideas what to do? ๐
I’ll have to get back to you on that one. The hacky solution would be to attach a an impulse actor to the player on PlayerSpawned so that there’s an outward force field around the player to apply a force to the door. Right now it looks like contact with a player doesn’t impart any kind of force.
Thanks for the tutorial! Btw you can push the door with the pawn, all you need is “bPushesRigidBodies=true” on your pawn. Hope it helps ๐
Hi If you came here looking for an answer to question tahat “Chase” asked heres the solution:
Try to change your map name to be as simple as possible (no spaces or symbols like ()[]?+!”#ยค%…etc.)
Do you have a video of this? I am new to UDK and I depend on videos only. Thanks ๐
Like in youtube somewhere where i can download it?
I haven’t done a video for this, I’m sure someone else has.