Author: Fenway Powers

  • How To Import Your NPC From Blender Into Unity


    Step 1: Open your NPC .blend file in Blender.


    Step 2: Select your character’s model by clicking and dragging your mouse.

    You will know your character is selected once it is fully outlined in orange.


    Step 3: Press the Control and A keys at the same time. Then, select All Transforms.

    Explanation

    This sets the model’s scale to 1,1,1 and rotation to 0,0,0. This is how Unity expects imported models to be.


    Step 4: Ensure Face Orientations are normal. Do this by entering the overlays menu and checking the Face Orientation setting. Your character should now be highlighted in blue (NOTE: In more recent versions of Blender, the blue highlight may not show up).

    Move your view around your character and make sure there are no red highlights. If there are red highlights, see the Blender Tutorial How to Fix Face Orientations.


    Step 5: While your model is selected, start the .fbx file export by going to File -> Export -> FBX (.fbx).

    Explanation

    Unity prefers the .fbx file format because it’s a stable, widely supported format that imports consistently, while .blend files rely on Blender’s background conversion, which can cause version or compatibility issues.


    Step 6: Edit the export settings as so:

    1. Under Include -> Limit to, check the box for Selected Objects (make sure only your model is currently selected in blender).
    2. Under Include -> Object Types, click the selections while holding the shift key down until only Armature and Mesh are left selected in blue.

    Then, select Export FBX.


    Step 7: Open Unity, and navigate to the Assets/_Models folder in the project folder. Double click the _Models folder to enter it.


    Step 8: Import the .fbx file into Unity by heading to Assets -> Import New Asset...

    Then Select your .fbx file and click Import

    You should see your .fbx file in the _Models folder. If the .fbx file was placed in a different folder you can simply drag it into the _Models folder.

    You will notice that your character’s textured material is not currently applied to your .fbx file. This is normal, and we will import the texture in a later step.


    Step 9: Make a new Empty GameObject to hold your NPC model. Click the plus sign in the Hierarchy window, and then click Create Empty.

    Rename the GameObject to whatever you like.


    Step 10: Drag your model into the empty GameObject.


    Step 11: Import the model’s texture.

    1. Navigate to the Assets/_Materials/Textures folder in the project window.
    2. Then, head to Assets -> Import New Asset... and import the .png file of your model’s texture.
    3. Then, click and drag your texture from the project window onto your model in the scene view.

    Step 12: Save your NPC as a Prefab by dragging it from the Hierarchy Window into the Assets/_Prefabs folder in the Project Window.


    Next Steps:

    • Follow this tutorial if you would like to have your NPC move around in your experience.

  • How To Set Up Your Experience/Game


    Step 1: In Unity, navigate to the Barebones scene located in Assets/Pre-College/Scenes/Barebones. This is the scene in which you will create your own VR experience.

    This scene is set up and pre-configured with:

    • XR Origin
      • XR Controls Manager
    • Main Menu
    • Experience Manager

    Step 2: Set up your Experience Manager.

    1. Select the --- Experience Manager --- GameObject.
    2. In the Inspector Window, edit the values in the Experience Manager script to match your experience/game.
    Explanation of the variables in the Experience Manager
    • Sandbox Mode
      • When this is enabled, it will skip the menu and put the player right into the experience. The player will not be able to win or lose. Useful for testing purposes.
    • Current Score
      • Keeps track of the player’s current score. Don’t change this variable, it’s only here so it is visible to you during playtesting.
    • Starting Score
      • The score value your player will start with.
    • Score Needed
      • The score value needed for your player to “win” your experience.
    • Win At Reach Score Needed
      • If this is enabled, right when your player reaches the Score Needed, the player will have won and the experience will be over.
      • Disabling this variable only makes sense if you have the Timer enabled in your experience.
      • Disabling this variable allows your player to get more points than the Score Needed. This would be useful if you want your players to get a “high score”.
    • Timer Enabled
      • Enables a timer. Once time is up, the experience will be over.
    • Seconds
      • How many seconds it takes for the experience to end.
      • Only ends the experience if Timer Enabled is enabled.
    • Main Menu UI Elements
      • These will replace the text items in the Main Menu.
      • Your changes to these elements will only be visible during play mode.
      • DO NOT edit the text items directly on the main menu. ONLY edit them here in the Experience Manager.
    • Spawn Point
      • Reference to where to spawn the player once they leave the Main Menu.
      • You can move the Spawn Point GameObject to wherever you would like your player to start the experience at.
    • Disable Toggling Controls
      • Allows you to disable UI Elements for toggling Teleportation, Smooth/Snap Turn, and Continuous Movement.
      • For example, if you do not want your player to be able to turn teleportation on/off, you would enable the Disable Teleportation Toggle variable.

    Step 3: Set up your XR Controls Manager PC component.

    1. Select the XR Origin (Pre-College) object, which is a child of the --- XR --- object.
    2. Here, you can change the default movement and turning settings.
    3. DO NOT change the Disable Movement On Start variable.

    Next Steps:

    1. Set up win objects and win containers
    2. Set up your NPC

  • Intro to Unity Workshop

    Studio X’s Intro to Unity workshop is recorded on YouTube!

    You can view the slides for this workshop here.