#can you show your camera setting real

1 messages · Page 1 of 1 (latest)

opal flint
#

Hope its okay figured a thread would be easier to follow

#

I tried to remove the script you asked me to add and suddenly I got this message

swift birch
# opal flint

try removing the Alpha on the camera. Click the black color and put alpha to 0

opal flint
#

using System;
using System.Runtime.InteropServices;
using UnityEngine;

public class TransparentWindow : MonoBehaviour
{
// Import Windows API functions
[DllImport("user32.dll")] private static extern IntPtr GetActiveWindow();
[DllImport("Dwmapi.dll")] private static extern uint DwmExtendFrameIntoClientArea(IntPtr hWnd, ref MARGINS margins);

private struct MARGINS
{
    public int cxLeftWidth, cxRightWidth, cyTopHeight, cyBottomHeight;
}

private void Start()
{
    // Get the current window handle
    IntPtr hWnd = GetActiveWindow();

    // Set the window margins to make it transparent
    MARGINS margins = new MARGINS { cxLeftWidth = -1 };
    DwmExtendFrameIntoClientArea(hWnd, ref margins);
}

}

swift birch
opal flint
#

Ah I meant to send that in a code block

#

might have accidentally saved during play without realizing

#

I wouldn't put it past me lol

swift birch
#

oh alright

#

cause this will not work in Editor anyway

opal flint
#

oop I did it got carried away in the other messages lol

#

Should I just take that script and plop it over mine and see what happens?

swift birch
#

sure

#

i'd change the camera thing first

#

it could be the alpha

opal flint
#

or well code monkeys script lol

#

I have no clue how to code so why I'm doing this is beyond me lol

swift birch
#

You're on Windows right ? cause this only works on windows

opal flint
#

Yes

#

Windows 10

swift birch
#

okay

opal flint
#

I'm still getting that unknown script thing

swift birch
#

you're in playmode ? dont make changes during playmode

#

also again, this will not work in the editor at all

opal flint
#

OH I didn't exit it

#

I thought I did

#

I'msorrylol

swift birch
#

you're fine

#

just make sure you need to make a build for this to work since it uses native APIs

#

Im still leaning towards the camera background color wasn't set to 0 Alpha

opal flint
#

Just made that change, I feel like I've set it to 0 a few times now

#

I must have been doing it in play mode though

#

Running a new build now

#

okay so the hello world appeared, but it still is just a black background despite changing the alpha to 0

swift birch
#

is this with your old script or the new one ?
you saved the changes and all when building too ?

opal flint
#

Yep I made sure to save the changes, the build run was with your script

swift birch
#

strange.... ima gonna test it again just incase .. but I wonder if maybe 2D renderer is causing anything different

opal flint
#

Thats what I'm trying to figure out.

swift birch
#

huh thats weird now its not working lol..

opal flint
#

Atleast I'm not the only one strugglin x'D

swift birch
#

its working on my other machine tho :\

#

I wonder if there is some type of settings I missed between the two Unitys

opal flint
#

I'ma try a slightly different route, I think someone developed a forced transparency script so

swift birch
#

now its working again here ?
All I did was disable post processing on the camera but idk if its related. you can try

opal flint
#

I'm gonna see if that will work but idk

opal flint
#

I had tried that and still didn't work

swift birch
#

weird.. try running the build a couple of times.. lol no idea cause all the sudden it worked building it a second time, after I press OK on the message box it does load the transparency

opal flint
#

I looked into a bit and it seems like theres a conflict with unity versions

#

Seems the newest has a harder time consistently rendering transparent backgrounds

#

Gonna try on an older version and see what happens

swift birch
#

strange

#

im using 6.0.33f btw

opal flint
#

I've been on 6000.2.9f1

#

Looks like most scripts that do this worked in the 2022 versions so gonna try that

#

Its not like I need anything overly complicated anyway, just a simple idle clicky game

#

lol

swift birch
#

yeah its weird it should work regardless, but can be a hidden settings missing out on

#

Im also using DX11

#

gotta be some graphic setting or something

opal flint
#

Ill double check my settings and see if I can find anything. Perhaps I just missed something silly.

#

I genuinely thought this would be the simple part of the stage

swift birch
#

you could also check the Playerlog to see if any errors are coming up in the build