Jump to content

Door rotation after rotating building


xtom
 Share

Recommended Posts

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.

Check out my games: One More Day / Halloween Pumpkin Run

Link to comment
Share on other sites

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.

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 , ...

Link to comment
Share on other sites

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.

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 , ...

Link to comment
Share on other sites

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.

Check out my games: One More Day / Halloween Pumpkin Run

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...