Modding Tutorials

Discuss modding questions and implementation details.
Post Reply
User avatar
AlexanderSig
Posts: 324
Joined: Wed Jul 19, 2017 10:35 pm

Re: Modding Tutorials

Post by AlexanderSig »

I'm having a tiny issue when compiling a single model replacement as a mod. When I load the game the terrain loads fine but no buildings or any other models at all appear similar to what Uncanny_Valley was getting. I am very new to Unity so any help would be greatly appreciated.

Here's what I'm doing: Image

User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: Modding Tutorials

Post by TheLacus »

Welcome to the forums :)

The first step is to look for an exception in the log file, probably a null reference.

Note that if you compile as a debug build you get errors printed on screen, also for issues with materials etc. so it makes testing easier. Additionally when running a debug build you can import models directly from the assets folder in the editor so we limit the things that can go wrong.

I can't see anything strange with your screenshot but if I have to take a wild guess i believe there might be something wrong with the gameobject hierarchy. Can you expand the prefab and make a screen?

User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: Modding Tutorials

Post by TheLacus »

I'm talking about this:
GameObject.png
GameObject.png (12.9 KiB) Viewed 14892 times
If your model is inside an empty prefab like in this example, drag it out ;)

User avatar
AlexanderSig
Posts: 324
Joined: Wed Jul 19, 2017 10:35 pm

Re: Modding Tutorials

Post by AlexanderSig »

Here's the hierarchy Image

In the meantime I've gotten other models to work Image

User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: Modding Tutorials

Post by TheLacus »

What you can do even now is to set a component, Plane for example, as the parent and all the Plane.xxx as their children.
I've just made a PR which allows an empty prefab to be the parent, so this will be a possibility, too. Just pay attention to the origin.

Good work with the chair :)

User avatar
AlexanderSig
Posts: 324
Joined: Wed Jul 19, 2017 10:35 pm

Re: Modding Tutorials

Post by AlexanderSig »

TheLacus wrote:What you can do even now is to set a component, Plane for example, as the parent and all the Plane.xxx as their children.
I've just made a PR which allows an empty prefab to be the parent, so this will be a possibility, too. Just pay attention to the origin.

Good work with the chair :)
Great, thanks!

One final question... :)

I've been importing a bunch of models today and they show up fine in the scene window but in-game they all have weird rotations on them. They're set-up exactly like the original models in blender and I export them as Y up and -Z forward.

In-game: http://i.imgur.com/z8FHbap.png
Blender: http://i.imgur.com/QvaIKNb.png
Scene window: http://i.imgur.com/tTUm2aW.png - I think it's tied to this rotation quantity that's greyed out. I've tried setting the rotation to 0 on the mesh and making a new prefab like that but it always goes back to -90. I've also tried rotating the model in Blender and exporting it again but somehow that doesn't work...

That one chair model also has a much smaller scale than every other model even though I set the scale to 0.025 just like with all of my other models...

I had never used Unity before last night so sorry for all the questions. I'd really like to get these models released soon

User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: Modding Tutorials

Post by TheLacus »

AlexanderSig wrote: I've been importing a bunch of models today and they show up fine in the scene window but in-game they all have weird rotations on them. They're set-up exactly like the original models in blender and I export them as Y up and -Z forward.
I can import them correctly doing this:
  1. Rotate on x of -90
  2. Ctrl-A and apply rotation
  3. In the transform tab of blender set roation x: +90
You may need to do the same on z: -180.
I suggest you to try this plugin which does it automatically; apply full rotation fix and just export it as usual.
AlexanderSig wrote: That one chair model also has a much smaller scale than every other model even though I set the scale to 0.025 just like with all of my other models...
41100 and 41101 have the same size here, which model is the little chair?

User avatar
AlexanderSig
Posts: 324
Joined: Wed Jul 19, 2017 10:35 pm

Re: Modding Tutorials

Post by AlexanderSig »

Awesome! It works now, thank you very much!

Here's a comparison

Image
Image

I've finished about half of the tables, chairs and benches in this style already and I'm going to finish them all soon. The scale of the chairs is still a little small but I can fix that.

User avatar
Interkarma
Posts: 7234
Joined: Sun Mar 22, 2015 1:51 am

Re: Modding Tutorials

Post by Interkarma »

That's looking great!

User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: Modding Tutorials

Post by TheLacus »

Awesome, can't wait to play with this!

Post Reply