This article is about the assetpack that can be found here:

This assetpack has been built in Unity2019.3. Since the 2019.x version Unity has a new approach on prefabs. Prefabs can be nested, which has great advantages. However, projects that use nested prefabs can not be imported into older versions of Unity. That is … it needs some work to get it working.

If you follow the guide below, it will take you about 30 minutes to have the Steamboat assetpack work in Unity 2018.4.

  1. To get the assetpack from the Unity Store, create a new 2019.x project and import.
  2. Once imported, rightclick the “steamboat” fodler in the projectview and select “export package”.
  3. In the “exporting package” window, make sure everything is selected and click “Export…”
  4. Choose a name and location for the export and click save.
  5. Now close the Unity project and open or create a Unity 2018.4x project.
  6. In this 2018.4x project, in the project view, rightclick the assets folder and select “Import Package”>”Custom Package”.
  7. Select the package you have just saved.
  8. In the “Import Package” window, make sure everything is selected, and click “Import”.
  9. When the import is ready, in your projectview, go to “Assets>Steamboat>Demoscene”. Open the scene called “Steamboat Demo Scene”.

10. In your hierarchy view, select “Steamboat”. You will see that in the scenewindow no meshes are shown. The only thing you see are collider outlines:

You will need to attach all meshes to the prefabs. This is a bit tedious, but luckilly it doesn’t take too much of our time. The principle of all prefabs/meshes is the same. However, I will describe all of them for your convenience. Let’s start.

11. In the hierarchy view unfold Steamboat. Next unfold “doors”. Shift select the doors as in the image below:

Now, in the inspector notice that the mesh is missing:

Click on the little circle to the right:

In the “Select Mesh” window, enter “door” in the searchfield. Next doubleclick “Door_u”

The doors have now been added:

We’ll continue this approach to get all meshes in place.

12. Unfold “Door II” , select “Door (6)”. In the inspector, click the little circle right tot the missing mesh again. Search for Door again, and doubleclick “Door_u”

13. Repeat this for “Door II (1)” And the separate “Door (6)”.

14. Open the “Stairs Railing” folder. Select “Railing_Stairs”:

In the inspector, click the little circle right to the missing mesh (from now on I will simply write “select the mesh”. In the inspector, select the mesh called “Railing_Stairs_u”.

15. In the hierarchy, select “Stairs_Front”. In the inspector, select the mesh called “Stairs_Front_u”

16. In the hierarchy, open the folder “Railing”. Shift select all “Railing_Mains”. In the inspector, select the mesh called “Railing_Main_u”.

17. In the hierarchy, shift select all “Railing_Floor3_Stairs_Inside”. In the inspector, select the mesh called “Railing_Floor3_Stairs_inside_u”.

18.In the hierarchy, shift select “Railing_Construct”. In the inspector, select the mesh called “Railing_Construct_u”. From now on I will write this as:

“Railing_Construct” –> “Railing_Construct_u”

19. “Railing_Construct_RINGS” –> “Railing_Construct_Rings_u”

20. “Stairs_Small_Right” –> “Stairs_Small_Right_u”. (note there are three of them)

21. “Holder” –> “Holder_u”

22. “Wheel” –>”Wheel_u”

23. “Bottom” –> “Bottom_u”

“Floor3_part1” –> “Floor_3_part_1_u”
“Floor3_part2” –> “Floor_3_part_2_u”
“Floor3_part3” –> “Floor_3_part_3_u”

“Cabin_part1” –> “Cabin_part1_u”
“Cabin_part2” –> “Cabin_part2_u”
“Cabin_part3” –> “Cabin_part3_u”
“Cabin_part4” –> “Cabin_part4_u”

“Floor_2_part_1” –> “Floor_2_part_1_u”
“Floor_2_part_2” –> “Floor_2_part_2_u”
“Floor_2_part_3” –> “Floor_2_part_3_u”

“Floor_1_part_1” –> “Floor_1_1_u”
“Floor_1_part_2” –> “Floor_1_2_u”
“Floor_1_part_3” –> “Floor_1_3_u”

28. Select all shutters.
“Shutter” –> “Shutter_u”

29. “Chimney_Small” –> “Chimney_Small_u”

30. “Chimney_Large” –> “Chimney_Large_u”

31. “Mast_Front” –> “Mast_front_u”

32. “Mast_Back” –> “Mast_back_u”

33. “Gangboard” –> “Gangboard”

The result so far:

Now we are almost there! Some of the prefabs have a mesh colliders, which we’ll need to point tot the right mesh.

The mesh collider can be found in the inspector view.

The following prefabs need a mesh collider (prefab in hierarchy view –> mesh in Meshcollider in inspector):

Railing_Stairs –> Railing_Stairs_u
Stairs_Front –> Stairs_Front_u

Railing_Construct –> Railing_Construct_u
Stairs_Small_Right –> Stairs_Small_Right_u
Bottom –> Bottom_u

Floor3_part1 –> Floor_3_part_1_u
Floor3_part2 –> Floor_3_part_2_u
Floor3_part3 –> Floor_3_part_3_u

Cabin_part2 –> Cabin_part2_u

Floor_2_part_1 –>Floor_2_part_1_u
Floor_2_part_2 –>Floor_2_part_2_u
Floor_2_part_3 –>Floor_2_part_3_u

Floor_1_part_1 –> Floor_1_1_u
Floor_1_part_2 –> Floor_1_2_u
Floor_1_part_3 –> Floor_1_3_u

That’s it, have fun!

When navigating the mouse over the screen you only change two coordinates. A mouse cursor lives in a 2D world. In this article I will explain how you can get the position of a mouse click in a 3D world.

First, lets create a new Unity project. Name it as you like. Once the project is created, add a plane. scale the plane up. Next, ad some cubes and spheres.

Your scene should look something like below (does not need to be exactly the same, just add the plane, some cubes and spheres).

Next, Create a new material. Make it red. Also, ad another small sphere to your scene, drag the material to it so that you have a red sphere. Reset the sphere’s position (all 0). Now drag the sphere from the hierarchy to your assets folder. This will create a prefab from the red sphere. Rename the prefab to “RedSphere”, and delete it from your scene. We will use this red sphere to indicate where the mouse click appeared.

We want the game window to show the same as the designer window. For that purpose, make sure the designer/scene window shows all cubes and spheres. Select the camera, go to the menu [Game Objects]>[Align with view] to align the camera.

Now we need to make a script. This script will handle the mouse click. The script has to be attached to a gameobject in order to be activated in the screen. We will attach it to the camera. Create a new script, call it “ClickLocation” and add it to the camera.

Open the script.

To determine the click position of the mouse we will use ray casting. We will send a ray from the position of the camera to the position of the mouse. At the place where the ray collides with any object, that is where the mouse click is positioned.

To make this more visual, we will instantiate the red sphere prefab at the position of the mouse click. For this we’ll need a reference to the prefab in the script.

At the top of the script, make a serializable field of the type GameObject, with the name “redSphere”:

Save the script and return to the editor. The new field should now appear in the inspector:

Now drag the RedSphere Prefab to the Red Sphere field, or click the little circle at the right of this field and select the RedSphere from the list:

Now go back to your script. We will put the logic in the update method. This is what we will do:

1. Check if the mousebutton is released (we want the position of the mouse cursor when you release the left button);
2. If so, create a ray from the camera to the mouse position;
3. Cast this ray ( “fire the laser”). If it hits something, return the position where this hit occurred;
4. Instantiate a red sphere at the hit position.

Use the following code to accomplish this:

Save your script and run the game. When you click and release your button, a red sphere will be placed in 3D space!

In Blender, Shift-select the animated object ans its armature. So both are selected.

Go to File->Export, select FBX.

Next, browse to the folder where you want to export to, and enter an appropriate name.

Make sure to set the following configuration:

1. Check “Selected Objects”

2. At the right bottom, open the “Armature” settings and check “Only Deform Bones”, uncheck “Add Leaf Bones”

3. At the right top shift-select “Armature” and “Mesh”

Click “Export FBX”.

In Unity, Create a new folder under “Assets”. Give it an appropriate name (“Animations” in this example).

Now drag and drop your exported FBX file into this folder.

Done. From here on, you can setup and use the animation in Unity.

This is a short post. It is short because it presents a very simple solution. However, it is a solution to a problem that took me two days to solve.

As I do not want you to lose the same time as I did, I will describe the problem in a few sentences. I will state the keywords below, just to make sure you find this post if you have the same problem … I couldn’t find the solution myself in any forum, I found out by having some luck 🙂 And it is so simple….

The problem:

When you use multiple meshes that are connected to each other, e.g. for modulair walls, or if you use multiple point lights, you might end up with an annoying effect: not all meshes get the same amount of light. The image below demonstrates this. It is a screenshot from a scene in Unity, presenting two identical walls, with two identical lights. There is not any other light source in the scene. Take a look at the difference in lighting:

Different light effect on identical meshes

A more real-world example can be seen in the image below:

Different light effect on identical meshes #2

The walls are simple quads, with the same (seamless) texture applied to it. The scene has multiple lights.

How to solve this? It is very simple! Simply go to the lights that shine or should shine on the wall or that should somehow affect your wall. Next, in the inspector set the Render mode to Important.

That’s it! Check the image below:

Lighting fixed by setting the light sources render mode to important

Problem Solved! … took me two days experimenting with textures, different meshes, shading, smoothness … the solution was build into Unity all the time 🙂

Keywords: Unity 3D Light, Bug, Light Error, same light different effect, light interference, light shows seams, light shines differently on multiple objects.

Do you like the scene with the tables? You can get it here: