#can you show your camera setting real
1 messages · Page 1 of 1 (latest)
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
try removing the Alpha on the camera. Click the black color and put alpha to 0
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);
}
}
you saved during play or something ?
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
oh alright
cause this will not work in Editor anyway
in case you missed it, my script
https://paste.mod.gg/rrbaovtlfdrc/0
A tool for sharing your source code with the world!
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?
or well code monkeys script lol
I have no clue how to code so why I'm doing this is beyond me lol
You're on Windows right ? cause this only works on windows
okay
you're in playmode ? dont make changes during playmode
also again, this will not work in the editor at all
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
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
is this with your old script or the new one ?
you saved the changes and all when building too ?
Yep I made sure to save the changes, the build run was with your script
strange.... ima gonna test it again just incase .. but I wonder if maybe 2D renderer is causing anything different
Thats what I'm trying to figure out.
huh thats weird now its not working lol..
Atleast I'm not the only one strugglin x'D
its working on my other machine tho :\
I wonder if there is some type of settings I missed between the two Unitys
I'ma try a slightly different route, I think someone developed a forced transparency script so
now its working again here ?
All I did was disable post processing on the camera but idk if its related. you can try
I'm gonna see if that will work but idk
try this first
#1431352215242539180 message
I had tried that and still didn't work
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
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
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
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
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
you could also check the Playerlog to see if any errors are coming up in the build