Adding a Display Capture to OBS

I recently did a quick overview of how to install OBS here. The process to add display capture is as follows: –

  1. Click the “+” button in the “Sources” area

2. Select “Display Capture” in the list that pops up

3. Under “Create new” accept the default or name your display as you’d like and then click “OK”

4. Select the display you’d like to use and click “OK”

…and that’s it. If you’d like to add a webcam then take a look here.

Hope it helps!

Advertisement

Adding a webcam to OBS

I did a quick overview of how to install OBS here. If you’d like to add a webcam to that install then here’s how you do it…

  1. Click on the “+” in the “Sources” area.

2. Select “Video Capture Device”

3. In the “Create new” textbox enter “Webcam” (or whatever you want to call it) and click “OK”

4. Select the Webcam or capture device you want to use and press the “OK” button. In my case my webcam showed up as “USB Video Device”

5. The webcam will now show in the main view. You can drag and re-size it if required.

That’s the lot. Hope it helped!

Installing OBS

OBS is a handy piece of software for capturing and streaming video. I use it when I’m doing tutorials for work but I’m also going to start pushing “How To” videos so I thought I’d do a quick overview of the set-up process.

  1. First, go to https://obsproject.com/download and download the installer that works for your set-up. I’m using Windows 10 64bit for this example
  2. Run the installer and you’ll see the screenshot below. Hit “Next”

3. Accept the license information by pressing “Next” (if you’re happy with it that is)

4. Set the install location or leave it as default and click “Install”. Files will install to the selected location.

5. Click “Finish” to complete the install when you see the screen below.

6. When the app starts, select the type of activity you’ll be doing (streaming or recording). I set to “Recording” and then upload to YouTube later. Once you’ve made your choice, click “Next

7. I record from a specific monitor (selected in the pulldown in the screen below). I use the center monitor of the three I have and then put OBS on the right monitor so I can start/stop recording and change settings while recording as needed.

8. OBS will figure out the best set-up for you and then show you the settings. In my case the monitor I’m recoding from the UHD so it’ll auto-scale down to 1920×1080 to avoid too much bandwidth use.

…and that’s it. When you hit “Apply Settings” it’ll start the software and you’re ready to go.

If you’d like to add a webcam then take a look here for more info

If you’d like to add a display capture then take a look here for more info

Rename a member in Unity without losing the assignments in the Inspector

This is pretty simple when you have the right tag.

public GameObject m_foo;

To rename m_foo to m_bar without losing the assignments that have been set in a Unity scene, add the following on the line before the m_foo declaration: –

[FormerlySerializedAs(“m_foo”)]

Now rename m_foo to m_bar and go have a look at the scene in Unity. The member name is changed but the assignments aren’t lost.

Once you’ve been in to Unity and the scene has updated, it’s safe to delete the “[FormerlySerializedAs(“m_foo”)]” line as it’s not needed anymore.

Hope it helps!

Quaternions: Set up an Quaternion to give a specific angle on a specific axis

Again, just dropping this here so I know where to find it. The following will set up a 1 degree rotation around the x axis (in this case it’s just rotating a Unity transform by 1 degree in the x)

    Quaternion q = a_activeMesh.m_meshFilter.gameObject.transform.rotation;
    Quaternion q2 = CreateFromAxisAngle(1.0f, 0.0f, 0.0f, 1.0f * Time.deltaTime);
    q = q * q2;
    a_activeMesh.m_meshFilter.gameObject.transform.rotation = q;
Quaternion CreateFromAxisAngle(float x, float y, float z, float a)
{
    // Here we calculate the sin( theta / 2) once for optimization
    float factor = Mathf.Sin(a / 2.0f);

    Quaternion q;

    q.x = x * factor;
    q.y = y * factor;
    q.z = z * factor;

    // Calcualte the w value by cos( theta / 2 )
    q.w = Mathf.Cos(a / 2.0f );

    return q.normalized;
}

ADB Quick Commands

I keep looking these up, so dropping them here so I don’t have to: –

This will echo all output from a Unity project; adb logcat Unity:V *:S

This will echo all output from a Unity project to a file; adb logcat Unity:V *:S -d >> output.txt

This will clear the log; adb logcat -c

This will increase the buffer size so you have more than a few seconds before your logs start to disappear; adb logcat -G 16M

XCode: “iPhone is not available. Please reconnect the device.”

I upgraded my iPhone 11 to iOS 14 today and got the message “iPhone is not available. Please reconnect the device.” when trying to send an app to it from XCode 11.4.1.

The message doesn’t really match the problem, as the problem was actually that I needed to install XCode 12 in order to support iOS 14. XCode 11 doesn’t support iOS 14.

Quick fix; install XCode 12

Unity Build Failure, unable to update SDK

So, building on Android, I get the error; “Unity Build Failure, unable to update SDK”. The project I’m working on has been updated to a new SDK but Unity doesn’t have that SDK version installed

I used the SDK manager to update to the correct API but Unity didn’t see the change as Unity is looking at it’s ‘local’ version.

To solve this, you need to install to the specific Unity version that you’re using. Simple process; Open a CommandLine (CMD) as Administrator and type: –

“C:\Program Files\Unity\Hub\Editor\2019.3.11f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\bin\sdkmanager.bat” “platforms;android-29”

Obviously, you’ll need to adjust the Unity version and the Android SDK to what you need, but this does an in-place update of the Unity installed SDK.

Once you run that, Unity is happy again