xtom Posted January 7, 2015 Posted January 7, 2015 I added a swing door to a building using the SwingingDoor.lua script. I got it working pretty good and saved the building with door as a prefab but when I rotate the building to place it in a different location the swing angle on the door is off. Is there any way to keep the door swing angle relative to building. I thought making the door a child of the building in the scene tree it would do this automatically, but it seems not unless I am missing something. Quote Check out my games: One More Day / Halloween Pumpkin Run
MarkusR Posted January 7, 2015 Posted January 7, 2015 do not use the offset in script , its in world coords (relativ). move the mesh or pivot for the door to the left or right. if u use a 3d editor move the mesh to the left or right to the world center y axis. often a export use this world center 0,0,0 as mesh center point. Quote PC : Win 10 Pro 64 Bit , 4x cores ~2 GHz , 8 GB RAM , AMD R7 265 2D : Photoline , Zooner Photo Studio 13 , Art Rage Studio 3.5.4 , Ashampoo Snap 7 , ... 3D : Shade 15 Basic , Carrara 8.5 & DAZ Studio 4.8 , Cheetah 3D 6.3.2 , Via Cad 8 Music : Samplitude Music Studio , Music Creator 7 IDE : Leadwerks Engine 3.x , Unity 5.x , (Unreal 4.8.x) , AGK v2.x , Construct 2 , (Clickteam Fusion 2.5) , ShiVa 1.9 , Game Maker Studio , MS Visual Studio .Net , Android Studio , Monkey , ...
xtom Posted January 7, 2015 Author Posted January 7, 2015 I'm just using a simple box for a door not a model. I have set the offset to zero, thanks for that. To use a pivot do I make the door/box a child of the pivot or the other way around? And do I apply the script to the box or the pivot? Quote Check out my games: One More Day / Halloween Pumpkin Run
MarkusR Posted January 7, 2015 Posted January 7, 2015 yes, pivot should also work but don't know if u can save this combination as prefab. u need to turn the pivot. the other objects are relativ to it. the door is subobject. if u use the script offset, a normal door have x offset +0.44 m or -0.44 m. if the house wall is rotated +90 or -90 degree i remember i had exchange the x and z. but there was no preview in scene, so i used the other way. Quote PC : Win 10 Pro 64 Bit , 4x cores ~2 GHz , 8 GB RAM , AMD R7 265 2D : Photoline , Zooner Photo Studio 13 , Art Rage Studio 3.5.4 , Ashampoo Snap 7 , ... 3D : Shade 15 Basic , Carrara 8.5 & DAZ Studio 4.8 , Cheetah 3D 6.3.2 , Via Cad 8 Music : Samplitude Music Studio , Music Creator 7 IDE : Leadwerks Engine 3.x , Unity 5.x , (Unreal 4.8.x) , AGK v2.x , Construct 2 , (Clickteam Fusion 2.5) , ShiVa 1.9 , Game Maker Studio , MS Visual Studio .Net , Android Studio , Monkey , ...
xtom Posted January 7, 2015 Author Posted January 7, 2015 I've removed it from the prefab to see if I can get the pivot working with the door. So I have... Root -Pivot --Box If I rotate the pivot in the y axis in the editor the door opens/closes so I think I have that set right. I've applied the script to the pivot and removed the script from the box but I'm still struggling to get it working. I think it might be a matter of getting the right physics options for one or both, not sure and no luck so far. Quote Check out my games: One More Day / Halloween Pumpkin Run
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.