Collision Oddities On Models

Hey! I’ve been trying to learn a 3d modeling software to use in an upcoming project with Defold. I’m having some difficulties in my test scene. Not sure if I’m doing something wrong or not.

Oddity #1) Collision will turn sideways in editor but be fine in game.

Here is how it should look in game:

However, if I move it away from the 0,0,0 axis and reopen the collection, the collision will be displayed as rotated 90 degrees. When I run the game the collision is set up correctly (not 90 degrees).

Not sure if I am doing something wrong here or what.

Oddity #2) Changing the scale on a game object with a model will increase the size of the model but not the collision.

Here is a model at normal size:

Here is the same model at double the size but with the collision remaining at the original scale. This is how the collision is working in game too. I am confused since other models appear to work correctly. Not sure why the specific model is resulting in different collisions:

Any help to explain or help me fix these issues would be great. Thank you!

Could you please share a sample project that we can take a look at?

1 Like

Here is the github link to the project (was too large to upload here for some reason): GitHub - DrCampbell2017/3dOddities: Help with this 3d project please!

Sure! Here’s a sample project. It has two collections:

  • exampleCollection (shows Oddity #1 listed above)
  • scaleIssueCollection (shows Oddity #2 listed above) UPDATE: I figured this one out, I wasn’t scaling in all 3 directions, once I did that it began working correctly!

I am also having an issue with the capsule collider where it is letting the character phase into objects halfway.

I am using a lot of code from Dragosha’s light and shadow example, but I do not think that is related: GitHub - Dragosha/defold-light-and-shadows: Pack of shaders to make light and shadows in Defold.

When I opened the project the collision object was indeed rotated like in the screenshot, but after changing the rotation to some other value and then back to 90 again it started looking ok, no matter what I did to it. I am not able to get it to rotate incorrectly either. Can you walk me through step-by-step how I can achieve it starting from an empty project?

Ah, yes, you need uniform scaling probably, otherwise it will pick the smallest value.