#💻┃unity-talk
1 messages · Page 44 of 1
I think you've misunderstood what Elevate is. They don't post jobs there.
I've been getting this debug about auto reduction of punctual light shadows telling me to increase shadow atlas, but it's default 4k. What can I do to resolve this?
Last point is mentioning reducing the number of shadow maps active in the same frame, but not sure what it's referring to
I don't see anything there set to 4k...?
Shadow Atlas Resolution at 2048p?
so.. 2k
or do I need to change the high tier?
there's no 'p' on that either
it's not a screen resolution
default doesn't matter, if you're doing too much that can fit inside it.. then you're having a problem
just a few point lights in the scene
5 point lights, no directional
how many overlap and cause shadows on/from the same objects?
disable all but 1 and see if you still get it
I dunno the solution , just troubleshooting - though tbh, the answer will probably come up on google search
yeah its not there with just one on
Best solution I found is to disable the debug message 😂
Increase the value 'per object limit' is set to..?
you mean the per object limit? its 4
yep
the thing is, changing the shadow atlas resolution to 4096 makes it go away, but I'm not sure if I want to do that because it might be a hit on performance further on
you need to profile it and see
you don't just do/don't do something on feels just in case.. you test to find out if your feels are warrented
Unity 6000.3.1f1 Android IL2CPP build stuck at “Compiling Cpp for libil2cpp”
I am using Unity 6000.3.1f1 (Unity 6) on Windows and building for Android with IL2CPP.
The build freezes at:
Compiling Cpp for libil2cpp (arm32/arm64)
How long did you wait?
Did you check the editor logs for more info?
limit time
no
What do you mean? "limited time"?
I mean, it doesn't stop.
But how long did you wait for it to stop??
Android builds can take a while.
The export process doesn't complete and doesn't stop; it remains stuck on the same problem even when I cancel the process.
Can you answer the question please?
How much time did you give it before trying to stop?
OK. That might not be enough.
I'd try to give it some more time.
Other than that, monitor the editor logs, or maybe even break with a debugger and inspect what all the threads are doing. Perhaps there's an infinite loop.
Man? I waited for him for over 4 hours yesterday and the operation didn't happen, and I'll show you the log.
Build completed with a result of 'Failed' in 185 seconds (184555 ms) [12/17/2025 3:48:24 PM -> 12/17/2025 3:51:28 PM, 3m 04s]
TaskCanceledException: A task was canceled.
UnityEditor.EditorApplication:Internal_CallDelayFunctions ()
TaskCanceledException: A task was canceled.
UnityEditor.Modules.BeeBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <653e87cf2eee46cba35f0658f2b1887c>:0)
UnityEditor.Modules.BeeBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <653e87cf2eee46cba35f0658f2b1887c>:0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at /home/bokken/build/output/unity/unity/PlatformDependent/AndroidPlayer/Editor/Managed/ExtensionModule.cs:401)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTarget target, System.Int32 subtarget, System.String installPath, System.String companyName, System.String productName, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <653e87cf2eee46cba35f0658f2b1887c>:0)
UnityEditor.EditorApplication:Internal_CallDelayFunctions()
That's just showing that you canceled the task. There's no point in looking at it. You should check the logs at the point when it's stuck, before stopping/canceling it.
where is the logs ?
184555 ms 💀💀💀
hi ?
- Make a build
- Upload it to the platform of your choice
Is this for India also
The jobs literally list the location, if you look.
thats 3 minutes
India is not
then they are likely not hiring in india
How to add a plugin(my own dll) to the Unity project?
Okay, but first of all, they are:
https://unity.com/careers/positions?location=bengaluru
Secondly, if these don't apply to you, then there's no job available for you to consider
Thanks for assistance
So is there any site on which I can apply
Google. Just google jobs. There is absolutely no need to hold your hand here.
Sorry to be blunt but if you can't figure out how job listings work you're pretty much unemployable
at least by majority of those using those types of platforms..
unemployable a bit harsh.. it all depends
in the context of game dev positions not knowing how to find a open position probably does make you unemployable tho
considering the amount of competition
First they were reading Unity's guide for job seekers and thought it was an ad for an open position at Unity. Then they can't spot the location of jobs from a list that literally has nothing else than the job title and the location of the job. I can't imagine how they could realistically get let alone hold a job doing anything with computers
There's always nepotism, I guess...
can someone help me? i have an amd gpu and im trying to import some assets and none of them have textures that actually work
idk if its an amd thing or an asset store thing
are they pink?
yep
Convert then using Render Pipeline converter, its not a amd specific thing
how do I install android sdk for unity? It tells me to get it on unity hub but I can't find it anywhere
Add it as a module to a unity install
how?
here
whenever I try to create a new project I get hit with "Failed to load Mono. Please see Editor.log file for more information". All the stuff online abt this seems to be getting it when creating a build. Anyone know a fix ?
That means you didn't install that version of Unity via the Unity Hub.
but i did
Can you show how you did?
with the install editor button and selecting this version
maybe i should try reinstalling
Maybe. Are you installing it in a weird location?
And this time select Android module as well as windows (or your platform)
you saved me bro thank you so much
even the remove from hub button isn't working to remove this version wtf
use the uninstaller then..
I don't think
nope, its just more hassle
Btw you already had the android build support 
I installed it but I was missing a bunch of things
the sdk and two other things I forgot the names of
jdk
and didnt have all of this
what is stopping my enemey from going to point 2 after point 1
it genuinly just stops going
Well, with the information provided, I can only assume it's ghosts
Computer's haunted.
your code
im cooked
even chatgbt cant fix the code
and spent 20mins trying to
cant find it
so how else does one fix an issue
By debugging, reading docs stackoverflow etc
debug to find out what the issue stems from, and fix the root of the issue
i mean its running my other points work
but it just stops and runs on the spot at the first
first spot
point
so there's something different about that first spot, or how it's processed, maybe
log everything
That's what it does, it would somehow give a working code once then it just stops working
knowledge is power, log everything and you'll 100% find the problem
moneyback guarentee
moneyback?
ive just started
yeah, just a saying lol
its an enemy thats ment to run back and forth on a platform
but it runs to point 1 and stays there
does that prevent you from looking at the character?
see if it's running in place or just not running
is is constrained?
na its not frozen
do you have an animation for running
wait i see
ye
is that animation playing
its spawning on my point 1 for some reason
is it running in place, or just not running
running to poin2 and it dont know what to do after
yes
i know this sounds silly but thats not how code works
it does know what to do after
its doing it
your telling it what to do
what are you telling it
so sounds like it's just physically getting stuck on something
ye i think
check the terrain in that area for protrusions, maybe even listen for a collision message and see what you're colliding with
Why does everyone say "even ChatGPT can't fix it" like that's some indicator of how difficult the problem is instead of just the default state of ChatGPT.
"Guys my game is bugged and even my rice cooker can't solve it"
yh im cookked tbh
still cant figure it out
may have to put the fries in the bag
i mean this my first 5 hours on unity
following a video now im stuck
It is pretty sad that "even AI can't do it" is the throw the hands up moment for so many people.
But what's sadder is that among them is the belief that the problem and idea they have must be so unique and complicated that it must not have existed in any form prior to generative AI ... so anything from over 3 years ago. Yet one can literally just look at any game and know that's not true (obviously), yet zero critical thinking is involved to even come to that conclusion because "AI couldn't do it".
i fixed it
dw
that's a low bar
at least use an AI that is actually good at coding like claude...
flippin hell
struck a nerve when i said that
on the community
god dayem
hey theres an issue with that install
it may or may not have a security alert on it
technically it's not an issue with the install
they're probably well aware
Lol yeah. What's the thought process in that i wonder.
How to motivate myself to write code?
Purpose.
What works for other people is not going to work for you. You know yourself best and what motivates you best.
Well, nothing motivates me

Then don't wait for it
you kinda just... won't get anything done without some sort of motivation, either intrinsic or extrinsic
that applies to everything, not just programming or gamedev
I've figured out what I want to do, I'm thinking through the architecture for this idea, but when it comes to coding, I just can't do anything. 
just kinda how life works
@modern birch accept my friend req
please do not pester random people
ok
Don't randomly friend request people and definitely don't ping them in a public server to get them to acknowledge your spam
!collab
:loudspeaker: Collaborating and Job Posting
We do not accept job or collab posts on Discord.
Please, use Discussions to promote yourself as job-seeking, advertise commercial job offers, or look for non-commercial projects to participate in:
• ** Collaboration & Jobs**
i sent one message but ok
whats the game idea
this is not the place for that
Spam refers to quality, not quantity
@grave rock There's no off-topic on the server. Read #📖┃code-of-conduct
i didnt know that sorry
dms
yes, your messages are not conducive to that
my dms r off
Actual unity questions
oh
ok and someone wants to share their unity game idea
i wanna hear it
they were looking for collaboration
that isn't allowed here
And I sent them to the recruitment forum because that's not a unity question
we prefer to keep them on-topic, yes
can someone explain numthreads and Dispatch sizes to me? why not always use numthreads(32x32x1) unless I need that extra dimension ofc) and keep the numbers on Dispatch low? on the contrary why not do numthreads(1x1x1) and dispatch with the full texture dimensions?
yo can u add me in discord?
sure
alr send a friend request
welp, gonna see a case of the blind leading the blind here, aren't we
so passive aggressive keep it professional
yikes, this isn't worth my time
how to make a thread?
Hey guys, is there any way to add Box collider support for Cloth component?
There I mean
As in having your cloth component have a box collider, or have it interact with box colliders
interaction
@balmy kettle thanks
Ah, in there. I don't think you can, but I honestly don't know why
Input System problem (TRIGGER WARNING: I'M NEW)
Optimization I guess ¯_(ツ)_/¯
Probably. I just assume anything with the physics engine is running purely on black magic and Zeus decided boxes don't count or something
#⚛️┃physics might know more, or someone with more knowledge of the cloth component might show up here
yo
gurt be like👆
I'm trying to follow this unity learn tutorial https://learn.unity.com/course/tanks-make-a-battle-game-for-web-and-mobile/tutorial/scene-setup?version=6.3
and when I go to preview each of the level prefabs everything in each them is the like pink untextured color. Is there something I'm doing wrong here or is it a problem with the assets themselves or what?
Free tutorials, courses, and guided pathways for mastering real-time 3D development skills to make video games, VR, AR, and more.
this is kind of worthless for me lmao it just says "research errors"
I dont see any errors
are you certain you're using the built in render pipeline?
Yes I'm certain.
what do you see in the Graphics settings in your project settings
Oh word okay thanks, there wasn't anything selected. Is that the default? For there to be nothing there? I selected universal 3d when I created the project and then just installed the assets unity learn told me to install while changing nothing else
I selected universal 3d
so you were certain you were using BiRP even though you knew for sure you were using URP?
I dont even know what that means
BiRP = Built In Render Pipeline
URP = Universal Render Pipeline aka "universal 3d"
urp is a scriptable render pipeline, not built in
Alright. I'm following the most basic unity learn tutorial lmao I don't have deep knowledge of the render pipelines. I assumed what the tutorial told me to select would work.
okay and next time someone asks you if you are certain about something that you literally do not know, rather than making an assumption you could say something like "i'm not sure how do i check" instead of "yes i'm certain"
but since you don't actually have a render pipeline asset assigned you technically are using built in even though your initial intention was to use URP
importantly, the tutorial expects you to have used the "Universal 3D" template in Unity 6.3
which will give you a project that has the graphics set up appropriately
I thought that universal 3D was a default render pipeline which is why I felt certain. I didn't know they were separate
I'm on Unity 6.3, as the tutorial says I should be
it is, but it's the universal render pipeline which is distinct from "built in render pipeline".
hii
apparently not lol
No, it absolutely will.
You have either used the wrong template or accidentally messed with the graphics settings
I definitely didn't mess with the graphic setting and definitely selected universal 3D but okay
or deleted the render pipeline asset that was assigned
that is also possible, yes
question since ive been thinking about it, "reloading a scene" and "loading another scene and then the first scene again" can have very different results right?
i mean its obvious right or am i missing something?
there is one important difference if you've been modifying your assets at runtime
when you switch to a different scene, any assets that were only used by the original scene are unloaded
if you then go back to the first scene, those assets are loaded again
any changes you made to these assets are lost
most commonly: this happens if you've been modifying your ScriptableObjects
Reloading the active scene means that the assets are never unloaded
yo can someone help me fix this error? sorry if this is the wrong channel for this
that makes sense yeah
well the thing is reloading my scene takes quite a long time
so i started using my loading scene as a buffer
Similarly, repeatedly entering play mode will not cause assets to ever unload
makes sense
actually i got a really good idea now
for how i want to approach this
thanks
hello! can someone here help me with a problem im facing?
how did you install Unity -- through the Unity Hub?
uhh i once reinstalled windows and then had to reinstall unity hub but i still had unity 6 on my other drive
you probably need to reinstall it then
unity6?
you can add the existing installation
yes
i'd just remove and reinstall unity, yeah
i did but it gives me the error when i try to open a project
alr ty
i'm not sure why it'd break, but it's easy enough to do that
probably broken registry entries tbh
maybe Windows suddenly doesn't trust the executable
well, non-existent rather than broken
"wtf is this thing?"
it might as well be on a thumb drive you found in the parking lot 😉
Btw what is the best unity version for virtual reality games?
i dont think we are allowed to help you with that
probably the most recent stable release.
alr
its not allowed topic?
i think it fits under the umbrella of decompiling and moding so yeah
oh im really sorry, im new here
youre good
but im sure theres other places you could find answers to your issues, so dont give up or whatever
thanks, have a nice day!
yo when i try installing unity 6 this shows up please help
no permission to install in that location it seems like. make a folder on the D drive and install to that folder instead of to the root
alr ima try that
!install 👇 if you have further issues go through the check list
- Make sure you have enough space including on
C:drive. - Check that it's not being blocked by antivirus/security programs.
- Look through the logs for a real reason why the setup fails they are pinned [here](#💻┃unity-talk message).
If you still have issues, perform a clean install in another location:
- Install the Hub and Unity in a non-system drive or a clean new folder in the root of
C:drive. - Failing that use the recovery Refresh option or reinstall OS entirely then repeat the previous step.
Installing it on the root of the drive isn't ideal
Alr its installing now ty
!ask
:thinking: Asking Questions
:mag: Search the internet for your question!
:book: Use the API Scripting Reference and User Manual and this troubleshooting site for commonly posted issues.
:wrench: Attempt to debug your issue.
:thought_balloon: Find an appropriate channel by reading the name and description in #🔎┃find-a-channel
:grey_question: And don't ask to ask, ask a full question illustrating with screenshots if needed.
-# For more posting guidelines, go to #🌱┃start-here
!ask
:thinking: Asking Questions
:mag: Search the internet for your question!
:book: Use the API Scripting Reference and User Manual and this troubleshooting site for commonly posted issues.
:wrench: Attempt to debug your issue.
:thought_balloon: Find an appropriate channel by reading the name and description in #🔎┃find-a-channel
:grey_question: And don't ask to ask, ask a full question illustrating with screenshots if needed.
-# For more posting guidelines, go to #🌱┃start-here
you're meant to read the bot message not parrot the command
yo does any one want to help me create a gorilla tag fan game, hit me up
That's not a role you just pinged some random person
!collab
:loudspeaker: Collaborating and Job Posting
We do not accept job or collab posts on Discord.
Please, use Discussions to promote yourself as job-seeking, advertise commercial job offers, or look for non-commercial projects to participate in:
• ** Collaboration & Jobs**
Can u help me?
Its noth7ng hard
!ask
:thinking: Asking Questions
:mag: Search the internet for your question!
:book: Use the API Scripting Reference and User Manual and this troubleshooting site for commonly posted issues.
:wrench: Attempt to debug your issue.
:thought_balloon: Find an appropriate channel by reading the name and description in #🔎┃find-a-channel
:grey_question: And don't ask to ask, ask a full question illustrating with screenshots if needed.
-# For more posting guidelines, go to #🌱┃start-here
How do I use dat
even if it were a role, it is against server rules to ping people into your questions.
#📖┃code-of-conduct
You read it
I tried already
Does anyone know how to fix unity editor being stuck on 99%
? People say its ez fix
@stuck flower is that a yes
On yt nothing helps
can you be more specific
can you people read the bot messages jesus lol
read the bot message!
It's a bot command. Read the bot message.
Christ.
if those children knew how to read they'd be so mad right now
So when I download unity 6 lts editor downloads to 99% and freezies
!install 👇
- Make sure you have enough space including on
C:drive. - Check that it's not being blocked by antivirus/security programs.
- Look through the logs for a real reason why the setup fails they are pinned [here](#💻┃unity-talk message).
If you still have issues, perform a clean install in another location:
- Install the Hub and Unity in a non-system drive or a clean new folder in the root of
C:drive. - Failing that use the recovery Refresh option or reinstall OS entirely then repeat the previous step.
epic knowledge required
And my CPU shows no sign of anything downloading
why would CPU show it?
maybe they meant installing?
Ok taskmaneger
your cpu wouldnt show anything when you downloading something
Yea it shows activity
not when you are downloading something
the cpu has no part in that
just your drives and your internet lol
Blud
Well, it does have a bit of a part in it. It needs to run whatever program is doing the downloading. It's a small amount though, not easy to see in the task manager
I turned off real time protection
ok to be fair the cpu always does have a part in something, but downloading something wont show your cpus activity at a different amount
Yep
Its like 5%
dude

Why would you turn off your antivirus
And frozen at 99
Yeah, just being pedantic out of boredom
Antivirus and firewall might be blocking some files
It said
said what
Should I just get unity on the website not on the hub?
no, you should ideally use the hub to manage your installs. you just need to stop ignoring the instructions that were provided
then what did the logs say
so you didn't try them
you were given instructions.
gee, if only there were literally instructions that told you what you need to do
I dont get them
did you know that you are allowed to ask clarifying questions instead of just ignoring things you don't understand
Ooh ok
What do logs mean?
go to the bot message with the instructions, and locate the hyperlink that leads you to a pinned message
alternatively view the pinned message directly
In what channel
it has the location for the logs a type of txt file
Ts
anyways you can find the logs there
Ik as in discord on my phone
Did you not install the Unity on your phone?
No!
you need to actually locate the logs
Im getting on pc
on your computer
im back but on pc
so when i go to logs
is it unity hub logs or unity editor#
considering you don't even have the editor installed, what do you think it is?
it just says a buncvhh of letters and numbers
on unity hub
logs
csn i send a pic?
thats it
do you not notice there is a whole lot of sentences on the far right?
and that you can scroll towards them to read them
it shows the same thing top to bottom
scroll towards the right.
send me the whole error log i could prolly help u w that, do ctrl a and copy and paste it to me
please
alr man thanks
does anyone have this asset or can link it? If I remember correctly I think it was a free alien asset.
Ive looked and I cannot find it.\
May be deprecated
If i have an asset thats 256 x 2048 what do i set the pixel per unit at
Hi
With reverse image search best I found was an itch.io game that uses the model
oh thanks, it didnt appear when I did it, Ill look into it
so chances are it simply doesnt exist anymore
Where are the solo indie game developers learning everything from scratch
doing game jams, building bad games for learning, and stuff like unity learn
Thank you
no
Building anything at all?
yeah i post semi frequently in #🏆┃daily-win
Interesting
Sucking at something is the first step to being kinda good at something
I swear ive seen it before on the asset store. Only reason im looking for it is due to old games I used to play years ago using these.
@frank vigil im going down a huge rabbit hole here but this is hilarious
look at this
Who here builds their own sprites and who just hunts them
True but 😭
Treacherous Insect
@frank vigil the earliest i can find the use of the model is 2016
so do "Before:2017" in your searches
cuts down on the amount of results
how do you create a scene in unity and is there a way that on loading a scene it can take you straight to the next one?
- File -> New Scene
- Write a script that loads the second scene
Thank you!
does the script need to be a component of an object or is there a way to just have it running on its own
All scripts that run must be a mono behaviour, which needs to be attached to a game object.
alright, thank you
{
UniversalResourceData resourceData = frameData.Get<UniversalResourceData>();
if (resourceData.isActiveTargetBackBuffer)
return;
TextureHandle lightMapHandle = graph.ImportTexture(_lightMap);
//1
graph.AddBlitPass(lightMapHandle, resourceData.activeColorTexture, Vector2.one, Vector2.zero);
//////////////////
using IComputeRenderGraphBuilder builder = graph.AddComputePass("TestPass", out PassData data);
data.cs = _computeShader;
data.kernel = _kernel;
data.lightMap = lightMapHandle;
data.camNormal = resourceData.cameraNormalsTexture;
builder.UseTexture(lightMapHandle, AccessFlags.Write);
builder.UseTexture(resourceData.cameraNormalsTexture, AccessFlags.Read);
builder.SetRenderFunc((PassData d, ComputeGraphContext ctx) =>
{
ctx.cmd.SetComputeTextureParam(d.cs, d.kernel, "_lightMap", d.lightMap);
ctx.cmd.SetComputeTextureParam(d.cs, d.kernel, "_camNormal", d.camNormal);
ctx.cmd.DispatchCompute(d.cs, d.kernel, Mathf.CeilToInt(width / 8), Mathf.CeilToInt(height / 8), 1);
});
//2
graph.AddBlitPass(lightMapHandle, resourceData.activeColorTexture, Vector2.one, Vector2.zero);
//////////////////
}```
does someone know why putting AddBlitPass at position 1 works just fine but at position 2 it throws ** [AddUnsafePass] This API cannot be called when Render Graph records a pass, please call it within SetRenderFunc() or outside of AddUnsafePass()/AddComputePass()/AddRasterRenderPass()** although I am not calling it inside any of those? (I think?) edit: obviously I want it at position 2 after the compute shader did its thing
The way you're using using here fails to dispose the builder until it goes out of scope (after your AddBlitPass call)
you need to explicitly do this:
using (IComputeRenderGraphBuilder builder = graph.AddComputePass("TestPass", out PassData data)) {
// do all the stuff for the compute pass
}
graph.AddBlitPass(lightMapHandle, resourceData.activeColorTexture, Vector2.one, Vector2.zero);```
are you sure the brackets after using are correct? I've managed to fix it myself and I basically put everything from using up until Blit into brackets and that worked
{
UniversalResourceData resourceData = frameData.Get<UniversalResourceData>();
if (resourceData.isActiveTargetBackBuffer)
return;
TextureHandle lightMapHandle = graph.ImportTexture(_lightMap);
{
using IComputeRenderGraphBuilder builder = graph.AddComputePass("TestPass", out PassData data);
data.cs = _computeShader;
data.kernel = _kernel;
data.lightMap = lightMapHandle;
data.camNormal = resourceData.cameraNormalsTexture;
builder.UseTexture(lightMapHandle, AccessFlags.Write);
builder.UseTexture(resourceData.cameraNormalsTexture, AccessFlags.Read);
builder.SetRenderFunc((PassData d, ComputeGraphContext ctx) =>
{
ctx.cmd.SetComputeTextureParam(d.cs, d.kernel, "_lightMap", d.lightMap);
ctx.cmd.SetComputeTextureParam(d.cs, d.kernel, "_camNormal", d.camNormal);
ctx.cmd.DispatchCompute(d.cs, d.kernel, Mathf.CeilToInt(width / 8), Mathf.CeilToInt(height / 8), 1);
});
}
//2
graph.AddBlitPass(lightMapHandle, resourceData.activeColorTexture, Vector2.one, Vector2.zero);
//////////////////
}```
like this. I've learned that using means Dispose needs to be called so I'm letting the builder run out of scope which doesnt happen with brackets after it
yes brackets after using is correct
this is simlar, but you're doing it with an artificial scope
which is sort of awkward and weird
See the microsoft docs for using syntax. The very first example shows my style:
https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/using
the using statement without brackets (the style you're using) goes until the end of whatever the current scope is. You can see an example of that under the "You can also use a using declaration that doesn't require braces:" section in the doc
both are valid, but it's good to understand the original syntax with brackets. The no-brackets way is newer.
for something like this where you have a very well defined scope you want to define for it, it's cleaner to use the brackets syntax
I agree that it is awkward but it legit doesnt work with using { }
wdym
I think you probably didn't do your parentheses correctly
you can't do
using var x = xyz; {
}```
it's
```cs
using (var x = xyz) {
}```
using IComputeRenderGraphBuilder builder = graph.AddComputePass("ScreenSpaceLightPass", out PassData data);
{ code } is what I am doing
yeah that's not right
ah its that semicolon isnt it
you need the parentheses
and to get rid of the semicolon
using (IComputeRenderGraphBuilder builder = graph.AddComputePass("ScreenSpaceLightPass", out PassData data))
{
// code
}```
bonus fact, you can do use using but in the current scope
yeah, using var florp = whatever();
So I am making a custom Unity theme with uss style sheets, and I am wondering, is there anyway to know what these grey gui elements are called so I can reference them in my style sheet to change to blue?
Where can I find newer learning material for Unity? These tutorials and articles are all at least 4 years old and use scripts from long-deleted pages. There is literally nothing new. I've tried finding Youtube videos on the topic of floating origins yet the scripts they link are always from the Unity wiki page that is now deleted, so that tutorial can't even help me. There are other things too.
Not much has changed code-wise. If it's not related to networking or render pipelines stuff from four years ago should still work fine
You might need to change out a property name here and there, and you'll need to switch to the old input system probably, but it should still work
Honestly, I bit off more than I could chew trying to learn Unity at all
Maybe I'll figure it out eventually
But yeah, one of my problems was render pipline stuff earlier. It took me several hours, then finally coming across a single comment on a single reddit post to fix the problem.
i believe that they're .unity-and whatever they are (like buttons, dropdowns, text fields) (.unity-button as example)
there's a good chance that it's using IMGUI in which case you might not be able to access them through uss
How do you guys name your C# scripts? I always feel like I should be more consistent but like I'm not quite sure how parts of the name should be ordered. Like for a script in the player would it be better to call it PlayerWeaponManager or Player_WeaponManager or WeaponManager_Player
i def don't use underscores
personally I would reserve Manager for singleton related scripts that would only ever exist as 1 instance
which then moves that to PlayerWeaponController for me.
then i'd consider probably just reduce that down to WeaponController tbh, but perhaps in a /Player/ folder
I think either you could make what WeaponController does generic in a way that more than Player's could use it (therefor don't need to say Player) or that the code is so hyper-specific to the Player that the code makes it clear enough so you also don't need to say Player
Mmm makes sense. 🤔 Not using controller/Manager/Master interchangeably is also a big takeaway.
yee, i don't know if everyone follows that but i've seen that followed pretty commonly
if my scripts tend to do something, they usually end up ending in Behaviour, Controller or Manager
it's looking a lot better now
use the UIToolkit Debugger to inspect these elements
ah, gotcha, thank you!
Does anybody know how to toggle off the grid on top of my terrain...? It's hard to see sorry
Look at the top bar of Scene view
There should be a button that looks like a grid
You can click it
This button turns off the scene grid. It does not toggle this grid pattern that is specific to the terrain
try this one to the right
I also tried to change the texture. It doesnt seem to be a gizmo either
pretty sure thats the collider gizmo
Yes you guys were right. I had to toggle "Selection Wire" in gizmos. For some reason it still remained when toggling all gizmos
Thank you
is there a reason why everything in my animator is greyed out?
i cant seem to be able to do anything with it
do you have the object you want to animate selected?
does anyone know of some good tutorials to get more familiar with unity? (specifically 3D, and not unity learn)
i'm new to the engine but i also understand programming pretty well, as i've learned lua and gdscript
you specify not unity learn, but that has some of the best tutorials that will help familiarize yourself with the editor
i already understand the editor's functions, i guess i mean more in terms of the full workflow and how to go about creating mechanics for games
i did some starter tutorials for unity learn, but from there couldnt really find anything else on the site
well "how to go about creating mechanics for games" is not a unity-specific thing. but if you need to learn unity-specific stuff then the documentation and the learn site are the best options
One of the easiest beginner mistakes is not having a plan
Before you start trying to make things, sit down for a moment and plan some simple things
What is your game about? How does the player interact with it? What is the objective? etc.
This makes it much easier to develop your ideas quickly
yeah but then i terminally overthink everything and break my brain 
EVERYTHING
i come up with a cool idea and then overthink it and i end up not wanting to make it anymore, and am back where i started
this probably has something to do with the fact i'm autistic
While being autistic might play into it, worth noting a ton of the gamedev scene is neurodivergent
We can nitpick your problem further though
You asked for help getting familiar with Unity right?
If your getting stuck with that problem because your overthinking your own cool ideas, maybe don't use your own ideas
get comfortable remaking something that already exists
I personally think making a Calculator is a great way to get started in Unity since it's very basic but will get you comfortable with the basics of recieving user input, doing some code to handle values and using the ui to display the output
i realize that was the issue, though now for some reason animating a rotation will cause the object to do a weird spin before getting to the position im trying to get it at
im just trying to make something go up, but it's like turning sideways and then going up for some reason
it's kinda messy but the piece in the air is what im trying to rotate, yet for some reason it's like leaning sideways from a simple up rotation
from the looks of it the origin is messed up and for some reason there's no vertical axis??
Kind of strange question but lets say if my main mechanic of the game is riding on a boat, would it be in my best interest to use regular rigidbody or kinematic rigidbody? I feel like kinematic might be extra work to achieve that
i figured it out, creating a parent for the object fixed it for some reason
Why is it that when I create a new game object or drag a prefab into the scene hiearchy that its position coordinates are just seemingly random values often with a large trailing decimal?
Raise hands if you want to lick it
i need to ask
im using unity 6000+
is the syntax for rb.velocity and rb.linearVelocity the same?
It's the same, yep
well, that's good to know
does unity's default meshes like cube/plane etc not actually work with light baking ?
so i have import my own meshes just to test it
question does anyone remember the name the of the thing you can do that starts out as an animation but then switches to physics (im trying to make dominos but cant remember the name of what to search up)
Arrgh, collisions are killing me again. Anyone have an idea of how to fix this?
logic is null
ok, thanks. How do i fix that?
Put something to that field
in the editor?
It's your code, I have no idea what object "logic" should be
what
is that image what it should be defined as?
That would make it not null, yes
configure your ide
!ide
If your IDE is not autocompleting code or underlining errors, please configure it.
Select one:
•
Visual Studio (Installed via Unity Hub)
•
Visual Studio (Installed manually)
•
VS Code
•
JetBrains Rider
• :question: Other/None
i have
the screenshot shows you haven't
have you installed .net using the .net install tool?
It's clearly configured
What?
Just how do I fix it?
There isn't anything in the logic field for that object when the collision happens. You'll have to figure out why that is
So the script isn't in the field when I collide, correct?
the gameobject that the logic manager is on
why
in here it's correct
on the gameobject for the player
but it says nothing in the script inspector
What is the first screenshot? You cut out the script name
Collision2D and gameOver are not highlighted correctly there. (unless perhaps gameOver is a delegate - that still leaves Collision2D)
so sounds like you haven't completed configuring your ide
you'e installed the .net install extension, correct?
the bee script
what is the .net extention
then you need to set the reference for that script yeah
have you just not done the configuration steps at all then
That's just the editor's color scheme. Surely it wouldn't know about Unity messages if it wasn't configured
I'm using VS code
the other screenshot shows classes highlighted as normal
If your IDE is not autocompleting code or underlining errors, please configure it.
Select one:
•
Visual Studio (Installed via Unity Hub)
•
Visual Studio (Installed manually)
•
VS Code
•
JetBrains Rider
• :question: Other/None
VSCode isn't very consistent with the colors
it is, not sure where you're going there
they also like. seem to not know what the .net install tool is, so sounds like they haven't configured it
The plugin installs .net automatically
in my experience installing it manually and restarting vscode solves a lot of unconfigured issues
ive seen it try to install automatically but the results seem to not be super consistent
If you have issues. But you don't need to do that if it works the first go.
well it clearly didn't lol
Does it underline words in red if you make a typo in the code @obtuse rover ?
well, let's see. @obtuse rover are you getting intellisense? as in suggestions when you start typing them, which aren't just suggesting words (indicated by an "abc" icon)
Hey, guys! I know this has nothing to do with Unity but with Github. So, because I have a lot of assets on my Unity Project and I wanted to push them all on Github from Git, I have installed Git LFS on my Repo I have the specific .gitattributes file and its properly initialized. So, the problem is that I am getting this message after pushing. Does anybody know why this happens please answer because I really have to push all of my assets to my repository.
I am getting an error HTTP 500 and really dont know what this means.
it means the server did something wrong
4xx means you're the issue, 5xx means they're the issue
maybe try again later? im not quite sure what the next steps would be
how do u guys implement skinned mesh blood decals easily? been wondering for an easy way for the past 5 days
bruh chris fk u bro u dont teach any1 anything and ur just putting us down
I'm sure there are many ways.
One I can think of real quick is using vertex colors or a separate mask map that you pain on.
Am I right in thinking that unity is planning to update C# versions in the future
Think I saw it on the road map although I don't know when this is planned for
Yes. Will start with 6.4 and arrive in tranches starting with the next LTS until unity will always automatically use the latest .NET/C#
Ooh awesome, and will it speed up compile times
Nobody outside U can say what specifically it speeds up yet. In theory it could speed up time from project rescan to the first update in playmode. But a .NET update is not the primary bottleneck here. There are many inefficiencies in the domain reload that would still make it slow. U is working on these as a stated primary goal for the next versions (namely: ‘iteration speed’ across the board)
Note however that unity sees iteration as ‘from code/asset change to release build’ and ‘enter editor playmode after a code change’ is not really on their radar (yet).
I’ve heard though that in their own projects (survival kids) they have identified many issues in the editor workflow which ‘have been heard’ by the engine team.
Domain reload rebuilds the entire domain from scratch when only a tiny part actually changed. This can, in theory, be optimized via patching the existing memory or structures that allow partial replacement.
Yeah I mean i use a couple asmdefs - am I right in thinking when I change stuff inside/outside the asmdef other bits don't reload
Or is that something different
It is theoretically possible that unity gets hot reload
asmdefs only segment what needs recompile, not what needs reload
They seem focused on making unity reload while play mode is on, but I'm looking for speeding up the loading bar part when I come from script writing back to unity
Like recompilation and domain reload
Yes, most everyone would love that to be quick
domain reload being removed in coreclr stuffs
it’s one of the biggest issues unity has vs engines that use an interpreted scripting layer
I got rider which is really handy because I can like confidently write large chunks of code before reloading
Is it really?
Yeah fair
Whether domain reload can be removed depends on how stable that actually is. The engine still needs to maintain a bridge between coreCLR and itself. Which can go wrong in all sorts of ways. But if the engine truly gets rewritten to map better to coreCLR, it might actually happen —> hot reload
they said its gonna happen and they are usually pretty hesitant when they aren't sure
Do you have a reference for that, curious what specifically they promise currently.
one min but its in the reddit 6.3 megathread
See Code Reload section in this thread https://discussions.unity.com/t/coreclr-and-net-modernization-unite-2024/1519272
I don't believe Domain Reload is even a concept in modern .net, but I'm not deep enough into that to know for sure. I'm pretty sure this thread has a lot of discussion on it, but it has over 3000 replies sooo https://discussions.unity.com/t/unity-future-net-development-status/836646
Apparently, the new concept is AssemblyLoadContext
Yes, that (assembly load context) is the segmented optimization. It’s still similar to domain reload, just locally bounded and more sophisticated regarding invalidation.
What do you think of CryEngine? Could it add a good modeling engine to Unity?
what
It’s an entirely different engine.
CryEngine is a whole different engine
CryEngine is also unusable for small teams.
lol
best option would be to use blender for modelling or pro builder (if you are ok with low poly) otherwise Blender is king
Furthermore, the difficulty level should be medium, and not too high.
Unity cannot create and edit models, so I am looking for software that can.
I've tried Blender before, but it seems we're not a good match.
all 3d software is pretty intimidating
Blender is the best/free option.. you get better at it the more u do it..
(you can get away w/ blocking out levels and doing simple geometry using something like probuilder) in the editor itself
Unless you spend a lot of money on a paid modeling software, you’re stuck with blender.
and even then... professional software isn't all that easier
if easier at all
i'd much rather use Blender than Maya. 3ds max, or any autodesk
If you go into paid, look at 3DCoat, Maya, ZBrush (these are the industry defaults) with plasticity and shapr the CSG alternatives inspired by CAD workflows.
zbrush would be epic to have 😭
zbrush is more of a uv-editor/texture painter tho innit?
Only until you have it
Normal map painter going sculpture
yea yea.. the "juicy" stuff
For true sculpture: 3DCoat
ZBrush is ideal for what hifi AAA signaling needs: surface detail
but all said.. Blender is just a gatekeeper type of software...
its an entirely different type of workflow.. but once u learn the basics of fundamentals
all 3d softwares hve the same tooling, and majority of the important features
-# none of them are a "pleasure" to use
you can expect that users who come from Maya-like workflows have a very hard time adapting to blender and vice versa
extrude, scale, inset, rinse and repeat 😉
That’s just one way though 🙃
Maya's submenu's are like the backrooms
Keep it Unity related
teh same can be said for Blender's hotkeys
anywho TLDR...
- keep learning Blender (its worthwhile)
- use probuilder (in Unity) to get familiar with 3d modelling -> swap to blender
can anyone tell me how to get the screen dimensions in scene view? I'm currently using width = Camera.main.pixelWidth; height = Camera.main.pixelHeight; which works fine for Game view but not for Scene view
so there is a .camera property but its not static so I'll need a reference to the scenes SceneView I guess? how do I get that?
Like, read the whole page please 😄
yea mb its literally the very first thing lol
thanks you 2 :)
tires[i].transform.Rotate(Vector3.right, tireRotSpeed * VelocityRatio * Time.deltaTime, Space.Self); tireParentsFronts[i].transform.localEulerAngles = new Vector3(tireParentsFronts[i].transform.localEulerAngles.x, steeringAngle, tireParentsFronts[i].transform.localEulerAngles.z);
this is causing the tires to rotate in the z direction to -180 degrees for some reason. the rotate of tires keep glitching to -180 and back to 0 again even though the z is never touched
can someone help please?
Stop using euler angles for everything
euler angles are not unique
The ones you're seeing in the inspector are equivalent to whatever you assigned
ohh okay let me try using quaternions
!collab
:loudspeaker: Collaborating and Job Posting
We do not accept job or collab posts on Discord.
Please, use Discussions to promote yourself as job-seeking, advertise commercial job offers, or look for non-commercial projects to participate in:
• ** Collaboration & Jobs**
tires[i].transform.Rotate(Vector3.right, tireRotSpeed * VelocityRatio * Time.deltaTime, Space.Self);
tireParentsFronts[i].transform.localRotation = Quaternion.Euler(tireParentsFronts[i].transform.localRotation.x, steeringAngle, tireParentsFronts[i].transform.localRotation.z);
i am using this code now and the transform.rotate part is not working anymore. what can i do about that?
!ban 1233822400198742026 scam
@topdev0731 banned
Reason: scam
Duration: Permanent
wdym by "it's not working anymore"
like the rotation isnt happening along the vector3.right axis... it remains idle
the rotation on the x axis of the wheels as in
it increments a tiny bit when i hold vertical key though
Debug.Log the rotation before that line and after that line of code. Also log what VelocityRatio and tireRotSpeed are.
One of three things is happening:
- the code isn't running at all
- some other code iw running later and overwriting the changes
- it's rotating so slowly you don't notice it (or 0)
Debugging will tell you which
actually i have that script for only the front wheels, for the back wheels i have only the transform.rotate part and it works perfectly.
if (i < 2)
{
tires[i].transform.Rotate(Vector3.right, tireRotSpeed * VelocityRatio * Time.deltaTime, Space.Self);
tireParentsFronts[i].transform.localRotation = Quaternion.Euler(tireParentsFronts[i].transform.localRotation.x, steeringAngle, tireParentsFronts[i].transform.localRotation.z);
}
else
{
tires[i].transform.Rotate(Vector3.right, tireRotSpeed * VelocityRatio * Time.deltaTime, Space.Self);
}
if i remove the transform.localRotation statement for the front wheels it works normally, except it doesnt rotate while steering
Cool story, but you need to debug your code
but yeah that's a clear sign the other code is simply overwriting whatever the first line is doing
but then that is run after the first line... how does it overwrite? and what exactly should i debug? i know that velocityration and tirerotspeed arent the issues as i can tell from the back wheels
Also switching from .localEulerAngles = to .localRotation = Quaternion.Euler(...) doesn't actually change anything
those are functionally equivalent
aww man... what else should i use? transform.rotate?
I have no idea what you're trying to accomplish so it's really hard to say
I don't know how your objects are set up
What the game is
or what this code should be doing
well the transform.rotate statement managers the rotation of the wheel in the x axis, (for linear movement). it uses the tireRotSpeed which is constant and velocity ratio, which is current speed / maxspeed.
transform.localRotation manages the front two wheel's steering angle.
i already have a working car, im just trying to rotate the wheels for the visual effect.
i = 0,1 are the first two wheels
Making the following assumptions:
- the
tiresobjects are children of thetireParentsFrontsobjects - The tires should only rotate on the local x axis
- The tire parents (wheels?) should only rotate on the local y axis
Then:
tireParentsFronts[i].transform.localRotation = Quaternion.Euler(tireParentsFronts[i].transform.localRotation.x, steeringAngle, tireParentsFronts[i].transform.localRotation.z);
is wrong.
It should be
tireParentsFronts[i].transform.localRotation = Quaternion.Euler(0, steeringAngle, 0);
And if those assumptions are not correct then you'd have to explain how everything is set up
sorry for the mixup. tires[] and tireParentsFronts[] are different. tires[] is the parents of the wheel meshes and tireParentsFronts[] is the exact same as tires[] except that it is just the front 2 wheels
well that's your problem then
You should set up the herarchy like this:
Wheel
Tire (child of wheel)
Then you should rotate the Wheel object like: wheel.transform.localRotation = Quaternion.Euler(0, steeringAngle, 0);
and the tire object like: tire.Rotate(Vector3.right, tireRotSpeed * VelocityRatio * Time.deltaTime);
currently you're trying to rotate a single object in two different ways, one of which is an overwriting way.
It's much simpler to manage this multi-axis rotation by splitting things up into two separate objects.
ohhhh i see it now...i thought since the second line was after it wouldnt cause the issues
The names don't have to be "wheel" and "tire"
thanks a lot bro you're a lifesaver
Guys, do u know if Unity's axis system from " Texture2D.GetPixel " has the (0, 0) in the lower left corner or in the upper left corner like most image processing cameras do?
Have you checked the documentation for GetPixel?
https://docs.unity3d.com/6000.0/Documentation/ScriptReference/Texture2D.GetPixel.html
its clear in the docs @hot tundra
hey what do i need to use if i want to fill a (stretched out) square sprite with an image that repeats itself and i can change the ppu
might be better off just using a quad for that, then editing the offset and tiling paramaters in the material
@cobalt sequoia
ok lemme look up what a quad is
ok im gonna try it out
Thanks. I checked, but wanted to make sure I understand it the right way.
is there any other way?
I've opened my project on my laptop, and I'm finding a coroutine I have isnt running the same way on here. I'm instancing tiles, but they only get created when I mouse over the inspector or select an object in the heirachy.
On the PC things just update without me needing to do anything
How do I apply a repeating texture on a sprite?
You'll have to use a custom sprite shader
could you give me a yt tutorial please?
GUYS
im working on a game
and in the main menu
this is how it looks
Image
anyone know how to make it look better
i cant change the position of the dude
but the texts and logo i can
i cant change the background
or the d ude
only the text
and the logo
And with a random couple lines. A glimpse of hope for seeing CoreCLR has appeared in the patch notes for new Unity version.
Hello, Ive done a quick search and cant sem to find what im looking for. I have some low poly characters, and they have a mesh for their hair. I am looking for a hair texture. Im not animating hair, i just want to texture it to look like hair (preferrably black or very dark) anyone have a line on something like that? Picture is the figure in blender, but you can see the "hair" is just a blob
not till 6.7 iirc
So yes, and no. This is from todays release patch notes.
So they are doing it incrementally. Today they pushed the start of the newer .net for editor and the build system. Which is still a huge step forward.
Than they got to to runtime .net 8 which should let us use newer API for more recent C#.
Today's update is a step forward with the compiler.
Link to this morning new Unity alpha version. It is in the Changes sub section with the Build System changes.
<@&502884371011731486> ^ scam
Ah the lengths people go to for crypto scams.
?ban 1446511460846014631 scam bot
hsiebbei_28488 was banned.
can someone help me here
why not
its a background image and i already have a picture
i cant change it cuz i gotta reimport the models and do it again
even i were to do it
what would u recomend
Just going with whatever you currently have
With a menu that looks like that I don't think it matters
Your time is better spent elsewhere
Unity domain reload can be so slow... Working on an inherited project so I can't add assembly definitions or anything like that
Not asking for advice, just a random vent
eventually it will be gone
I change one line of code and it takes 60 seconds to load before I can test
Oh please do tell
Is there an update in the works or something?
coreclr stuff
I will research what that means
The Common Language Runtime is the VM that runs your C# code (Actually for everything, not just Unity)
Unity doesn't use it yet, it uses a different VM named Mono
There are plans to switch to it from Mono but no idea when
Oh
Goody good
Let's hope that comes soon
My mental health will literally improve just from that
Does anyone know if there is a tool to paint colliders in 3D space kind of or would a lot of box colliders be better?
You could use a Mesh Collider with whatever mesh you want but in general making a composite of simple colliders is better
it doesnt require it but everything looks a lot better when your lighting is baked
you can also just keep it realtime
I don't see how it can be baked if it's generated at runtime. In fact, it's grid-based, and I only plan to have about 10x10 cells visible at a time. It's like a grid-based dungeon crawler in first person view.
yeah procedurally generated means you're going to lose out on the benefits of baked lighting. also can't use occlusion culling either since that requires baking the data too
I heard Unreal's Lumen would work better.
you could theoretically
prebake the lighting if the individual pieces of your dungeon are big enough
Okay.
i think their might be some solutions for baking at runtime but theres like a million caveats to it
Sounds like a disaster waiting to happen.
the major downside is that it would still look kinda not good
but will be better than realtime lighting
How much stuff is in your game? I would say a 4 hour build is not normal but it's possible if you have a lot of assets
not alot
im pretty sure it got crashed
I would probably restart it
maybe it still building
doing it for android btw
and this thing aint working too
If you want to buy assets, there is HTrace and AdaptiveGI that does the same thing lol
then ask
this
and...?
more sentences plz
and i use raycast
i have thedamage and enemy health but somehow there is no hit on the target
AdaptiveGI looks neat. Is it for any environment? The game features procedural dungeons and forests mostly.
I haven't used it in a real project yet, but it seems to work pretty well
just read the documentation
Oh, didn't notice the extra video previews.
i will send a video
You're going to need to show some code and be more descriptive about what is actually happening
!code
📃 Large Code Blocks
Use links to services like:
https://paste.mod.gg/, https://hastebin.skyra.pw/, https://paste.ofcode.org/, https://paste.myst.rs/
📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To format as C#, add cs to the first line:
```cs
// Your code here
```
Add a comment with a line number if there is an error message.
this doesnt help us at all
i dont knwo if is the code or something
using UnityEngine;
public class WeaponUIShoot : MonoBehaviour
{
public int damage = 20;
public float range = 10f;
public LayerMask enemigoLayer;
public GameObject shootEffect;
public float effectTime = 0.1f;
public Transform firePoint;
void Update()
{
if (Input.GetMouseButtonDown(0))
{
Shoot();
}
}
void Shoot()
{
// Efecto visual
if (shootEffect != null)
{
shootEffect.SetActive(true);
Invoke(nameof(HideEffect), effectTime);
}
// Posición del mouse en world space
Vector3 targetPosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);
// Dirección desde el firePoint hacia el mouse
Vector3 origin = firePoint.position;
Vector3 direction = (targetPosition - origin).normalized;
// Raycast 2D
RaycastHit2D hit = Physics2D.Raycast(origin, direction, range, enemigoLayer);
// Debug para ver el raycast
Debug.DrawRay(origin, direction * range, Color.red, 0.2f);
if (hit.collider != null)
{
EnemyHealth enemy = hit.collider.GetComponent<EnemyHealth>();
if (enemy != null)
{
enemy.TakeDamage(damage);
}
}
// Para ver el raycast en la escena
Debug.DrawRay(
firePoint.position,
firePoint.right * range,
Color.red,
0.2f
);
}
void HideEffect()
{
shootEffect.SetActive(false);
}
}
this is the code i using
not reading alat without inline or a pastebin
📃 Large Code Blocks
Use links to services like:
https://paste.mod.gg/, https://hastebin.skyra.pw/, https://paste.ofcode.org/, https://paste.myst.rs/
📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To format as C#, add cs to the first line:
```cs
// Your code here
```
Add a comment with a line number if there is an error message.
you are using a 2d raycast are you aware
using UnityEngine;
public class WeaponUIShoot : MonoBehaviour
{
public int damage = 20;
public float range = 10f;
public LayerMask enemigoLayer;
public GameObject shootEffect;
public float effectTime = 0.1f;
public Transform firePoint;
void Update()
{
if (Input.GetMouseButtonDown(0))
{
Shoot();
}
}
void Shoot()
{
// Efecto visual
if (shootEffect != null)
{
shootEffect.SetActive(true);
Invoke(nameof(HideEffect), effectTime);
}
// Posición del mouse en world space
Vector3 targetPosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);
// Dirección desde el firePoint hacia el mouse
Vector3 origin = firePoint.position;
Vector3 direction = (targetPosition - origin).normalized;
// Raycast 2D
RaycastHit2D hit = Physics2D.Raycast(origin, direction, range, enemigoLayer);
// Debug para ver el raycast
Debug.DrawRay(origin, direction * range, Color.red, 0.2f);
if (hit.collider != null)
{
EnemyHealth enemy = hit.collider.GetComponent<EnemyHealth>();
if (enemy != null)
{
enemy.TakeDamage(damage);
}
}
// Para ver el raycast en la escena
Debug.DrawRay(
firePoint.position,
firePoint.right * range,
Color.red,
0.2f
);
}
void HideEffect()
{
shootEffect.SetActive(false);
}
}
yes i am
Are you making a 2D game
yes?
do you know what 2d means
...really?
look at that simulated 2d shadow
well is in a 3d world
and those 2d cubes
your game is 3d
sorry to break it to you
so if you want your raycast to hit something at depth
it needs to have all 3 dimensions
In what way is this first person shooter a 2D game
the original doom was actually a 2d game
but yours isnt
regardless of the fact you want to make it a doom clone
thsi siteh title of teh game
ok.
not exactly
the is christmas theme
This doesn't answer the question
Yeah but this video shows them aiming up and down so it's not Doom-2D either
using UnityEngine;
public class EnemyHealth : MonoBehaviour
{
public int maxHealth = 100;
private int currentHealth;
void Start()
{
currentHealth = maxHealth;
}
public void TakeDamage(int damage)
{
currentHealth -= damage;
}
public void TakeRaycastDamage(int damage)
{
currentHealth -= damage;
Debug.Log("Enemy hit by raycast. Health: " + currentHealth);
if (currentHealth <= 0)
{
Die();
}
}
void Die()
{
Destroy(gameObject);
}
}
this one is teh enemy health
i'm really surprised that the chatbot authored Physics2D.Raycast
how's that surprising
Oh right it's AI of course. That explains why it's garbage
i think the user is copying and pasting small pieces of individual questions in
to solve problems
i honestly wouldnt even blame the ai here, i think this guy probably convinced it he is making a 2d game
if you tell it your game is 2d, it's going to use 2d raycasts
can you click the little share button in the chat where it said "Physics2D..."
*From each weapon's script, you reference the enemy's script, and upon contact with the shot's raycast, you lower the enemy's script's life variable
this is what i must do
well what's your goal?
If you want your raycast to detect something you need to actually use the right physics engine
have you tried just using the 3d raycast instead lol
there's a lot to learn here haha
You are not making a 2D game
it's not that bad
A 2D raycast will not work
if you see stuff like X then X2D (like Physics vs Physics2D, or Rigidbody vs Rigidbody2D, etc) then the one without 2D is the 3d version
dude how do i reduce this, its my 6th attempt now
what i want to reah is make the gun hit the enemy
this is charming
are you listening to the things we are saying to you
have you looked in the asset store for "boomer shooter" assets?
You should read the answers you're being provided
yes and i taking notes
haha
theres no notes to take
your game is 3d
any kind of 2d raycast wont work
okay..so i changed to 3d
i mean, something like this would be pretty worthwhile to make a mental note of 
i think if you want to use ChatGPT to help you write scripts, you have to use it differently
is tehre a way i could share my screen in livee?
it's not really necessary. Just click the prominent "Share" button at the upper right corner of the chat in chatgpt.com, then click copy link, then paste it here
Is there no ability to only show decals only on certain layers (Not rendering layers)?
there is, it's a render feature
in URP
you have to check some boxes.
so any code that can help me?
you can focus on what i am saying
If you're going to tell someone to make their life harder and their code worse at least don't tell them to waste everyone's time by posting it here
i dont plan to use chatgpt
well first off, have you changed your raycast to the 3d version
Interesting, I am only seeing these options
hmm.... who authored this code?
// Efecto visual
if (shootEffect != null)
{
shootEffect.SetActive(true);
Invoke(nameof(HideEffect), effectTime);
}
// Posición del mouse en world space
Vector3 targetPosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);
// Dirección desde el firePoint hacia el mouse
Vector3 origin = firePoint.position;
Vector3 direction = (targetPosition - origin).normalized;
// Raycast 2D
RaycastHit2D hit = Physics2D.Raycast(origin, direction, range, enemigoLayer);
// Debug para ver el raycast
Debug.DrawRay(origin, direction * range, Color.red, 0.2f);
then do so
As mentioned multiple times, a 2D raycast will not work for your 3D game
i'm not litigating whether or not it is LLM authored or whatever. it's just a question of using your tools correctly
So you need to change it to a 3D raycast
which pipeline?
so now i changing to 3d raycast
pretty sure on hdrp materials you can disable decals or whatever
Currently URP 17.0.4
maybe check the material/shader options
if it has something
if not then idk lol
Yeah I may have to make my own renderer feature for this. Appreciate the help in trying to find a solution
where is this from?
I did a quick comparison check on GPT.
using UnityEngine;
public class WeaponUIShoot : MonoBehaviour
{
public int damage = 20;
public float range = 50f;
public LayerMask enemigoLayer;
public GameObject shootEffect;
public float effectTime = 0.1f;
public Transform firePoint;
void Update()
{
if (Input.GetMouseButtonDown(0))
{
Shoot();
}
}
void Shoot()
{
if (firePoint == null) return;
if (shootEffect != null)
{
shootEffect.SetActive(true);
Invoke(nameof(HideEffect), effectTime);
}
Ray ray = new Ray(firePoint.position, firePoint.forward);
RaycastHit hit;
Debug.DrawRay(firePoint.position, firePoint.forward * range, Color.red, 1f);
if (Physics.Raycast(ray, out hit, range, enemigoLayer))
{
EnemyHealth enemy = hit.collider.GetComponent<EnemyHealth>();
if (enemy != null)
{
enemy.TakeDamage(damage);
Debug.Log("HIT A " + enemy.name);
}
}
}
void HideEffect()
{
if (shootEffect != null)
shootEffect.SetActive(false);
}
}
okay, it's enabled, use rendering layers is checked.
first select the object you want the decal to stick to like your floor or whatever. go fin dthe mesh renderer component on it and open up additional settings. you gotta switch the rendering layer mask from default to something specific like layer 1. then go over to your actual decal projector object and find that same rendering layer mask setting. just make sure to uncheck everything else and only check that same layer you picked earlier so they match up.
you don't need a render feature
changed to 3d
alright, do you have issues now
gonna test
Sounds good, I was hoping I could use the standard layers, not the rendering layers. Thanks for this!
you shouldve tested before sending here lol
if you don't have issues, then no reason to
still dont work
are you creating your own art assets? like are you a 3d artist or are you working with one?
and what's the issue now
=>