#💻┃code-beginner
1 messages · Page 783 of 1
Okay, so I'm trying to make a civ like game by following a game dev guide video (https://www.youtube.com/watch?v=EPaSmQ2vtek) but I'm following exactly what he's saying. Now I've got a problem with the player movement on the tile; whenever I click on a tile, the player doesn't move on it, and I'm not sure if it's because of the map generator, the tiles, the player, or the camera. This is why I fought it was easier to give the game (it's not that big) for you to help me find out
well youre going to have to start debugging it
set up debug lines everywhere you can and try and pinpoint at which point is it failing
deduce if its the generator, tiles player or the camera
hey guys iam starting on my first Incremental game. How do you handle big numbers? You think that long type is enough? Or build something to handle really big numbers?
BigDouble is the typical solution since you'll definitely want to handle numbers beyond what a long can handle
Do you mean BigInteger? i dont know about bigdouble is it like a mantissa and exponent thing?
I think eventually you start using StringBuilder or something, right?
or like usually these games you get to a point where those lesser values are nothing and can be rounded off
thanks guys, i check the breakinfinity out
if you only want to support integers, then sure that would work. if you want floating point numbers (which is typical in incremental games) then you want to use BigDouble
but no matter what, long/ulong wouldn't be enough considering ulong only supports up to about 1e19
but also afaik BigInteger has a much bigger performance impact than BigDouble
And depending on the wanted numbers, you can get very far with just double/ulong tbh. I've played many incremental games where they just cap at those
I'm pretty sure I've played clickers where with rediculous values where no value type could work
it eventually becomes fluff
They get to a point where you wouldn't notice you getting shammed by having some of those values rounded off
That's part of why BigDouble is so performative, it sacrifices accuracy for speed so when you do get to those much larger numbers it's less accurate but still much faster than something like BigInteger
what kind of incremental game caps anything 
seems like a huge sin for a game to do that in said genre
The ones I play aren't idle games, so they tend to be progression focused through user actions. Idle games it would make sense for it to not be capped sure.
it does seem kind of silly for a game where the whole point is "number go up" to make the number stop going up
also if you have to cap anything you might as well do it within some kind of prestige system
where you basically say wow your number got so big you are now on numbers 2™
wow that BigDouble works really good, exactly what i was looking for. Thanks again
it helps that it was literally made for an incremental game lol
I created an airdash but the box collider would loverlap too much with another box collider. I heard suggestions to use addforce cuz this prevents this but Im getting more of what I want from rb.linearVelocity
Does addforce prevent box colliders from overlapping? I dont think thats possible is it?
Would it matter when picking between linearvelocity or addforce
provided you are moving the object with physics (like with setting velocity or adding force), it is dynamic, and both colliders are not triggers then if they are overlapping you need to adjust the collision detection mode on the rigidbody, the default is typically good enough, but if you are moving things at higher speeds then you definitely need to change it so it can be better at predicting collisions to prevent penetration
simply changing from assigning the velocity to using AddForce won't really change a whole lot when it comes to collisions because AddForce is really just changing the velocity under the hood anyway (just with extra math that you are likely not doing yourself)
Ahh okay thats actually great then that means I can change my airdash code back to linearVelocity
Was having some problems with addforce anyways
Hey guys question, I have a parent class with a Start() function and a child class that inherits from the parent one. The Start() will not get called on the parent one? Only on the child one?
If its virtual then that depends if the sub class also calls base.Start()
otherwise no if the base is "hidden"
if you're going to go and paste the code into some site to share it anyway, at least use a site that shares the code correctly instead of screenshots
!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.
thats a first, sharing with the fancy reddit images
thats actually really neat, i wonder how its done
it's a nice extension (codesnap) in vs code
anyway Its as i said, SelectableObject.Start() wont get called here
it needs to be virtual so it can be called still
nope that doesnt make a difference
go learn about virtual methods
well technically it does, but only in the fact that private members cannot be virtual
gotta at least be protected
wrap it guys
is there anything wrong?
are we supposed to know what your issue is?
or are you just trying to show off whatever asset you're using to force the enabled checkbox on the transform component despite it not inheriting Behaviour to even have an enabled property
wdym?
i'm sure you're fun at parties
useless comments like that are not needed here, thanks
something gorilla.. sooo probably some type of brainrot question . project incoming
what? no its some tower defense im testing on
ok good.. so what is the problem cause you said nothing about it?
are you talking about transform having a enable/disable tickbox?
yeah i dont remeber it being like that
which version of unity is this? unless its an asset, I've never seen this
also next time this isn't a code question.. maybe..
note that transform does not and never had an enabled property which is what that checkbox even displays so whatever is causing the checkbox to show there is some third party asset
whats even the point of an enabled property on the transform lol
what does it do just freeze the transforms?
if only there was a system for that in unity
presumably this checkbox is purely cosmetic and doesn't actually do anything
Guys I need help with a school project its my first time on unity and i need to create a unity world create a player and be able to play the game on pc and on my VR headset my problem right now is that I 'm using the Kylebot asset and I don't know how to make him the character that the player plays as, also i dont know how to make the world be able to be played on VR. Please help me!!
!learn
:teacher: Unity Learn ↗
Over 750 hours of free live and on-demand learning content for all levels of experience!
:teacher: Unity Learn ↗
Over 750 hours of free live and on-demand learning content for all levels of experience!
wow
double kill
i was faster, at least on my screen, hehe
but yeah follow the learning pathways to get familliar with the basics
i mean i only have one day until its due, what is like the thing i need to know for my problem

a lot. there is no way you can get this done in only a single day with no experience
whats with like a million people on this discord that somehow all have unity school projects and its always like "create a highly ambitious project on your own lol, oh also you have 2 hours"
what kind of schools do you people go to
bot probably some poorly constructed online course
yeah but theres no way there we given one day to do this
even if they were expected to do it alone
a month at the very least
it's almost always overscope compared to assignment plus procrastination
i think procrastination is the major player here
Good evening, I'm having trouble with Unity. This error code appears when I launch a project: "Code execution cannot continue because Unity.dll failed to load. Make sure you meet the system requirements for Unity."
I've tried uninstalling the Unity vrctimes and Unity Hub, restarting, and reinstalling, but the problem persists.
Thanks in advance.
Lucas be honest with us how long did you have to figure this project out
curiousy has gotten the better of me
its prob a basic thing but yeah they are making the scope big because "game"
instead of pong or something small scoped
i dont need to create like a whole entire game i dont think i just need to have a player and play it on vr
was this an assigned project or were you given the option to choose what your game is going to be?
because if you can choose i say choose flappy bird or even pong
This is a code channel. #💻┃unity-talk and also make sure you do meet system requirements for the Unity version you are installing https://docs.unity3d.com/6000.3/Documentation/Manual/system-requirements.html
so you had 2 weeks to learn the Unity VR what did you do
This is not a place to solicit someone to make homework for you.
its a science fair thing where i have to create a world and change the size of it to see if you can feel the change of scale better in Vr vs regular videp games
If you have code related questions them ask them.
yeah lucas we cant really help you here because you need to actually have some basic understanding of unity outside of creating a "world", theres a lot of good videos online telling you how to set up vr controls for your game
:teacher: Unity Learn ↗
Over 750 hours of free live and on-demand learning content for all levels of experience!
in before "but I only have 1 day its due tomorrow"
already established... lol
Genuinely
I feel like unity wasn't made for me
Everytime i code i forget what i did
And then debug for hours
How do I stop players from just... scaling walls
it needs to be pretty much straight up for them to not be able to scale it
(using a char contoller, idk if that makes a dif)
thats why you use comments
and a lot of comments
nobody can remember everything they wrote
even after a day
Something about slope angle or something in the component, don’t remember exactly but it should be in the component somewhere
I forgot it and now im cooked
idk if the jump is using a raycast actually lemme check
well if you wrote something, experiment with it and you will figure out what your script does
Deadline is today midnight so can't do 🙂
pretty sure slope limit only works when you are grounded
you are going to need some way to cancel the upward movement of players when they hit sloped walls
University assignment
Yeah I checked and it said I was grounded in that image
im using just the character controller ground check
what kind of assignment and how much time did you have?
Any game that meets some criteria
does your grounded check account for angles?
Not sure about time because i forgot
built in?
im going to change it to a really small ray cast
into what
not a good solution
if you go to the controller class how does it implement isgrounded...
you should probably use your own isgrounded check using a raycast
because youre going to need that raycast to check if its hitting a sloped surface
yeah
basically if the surface the raycast is hitting has an angle larger than your slope limit return false for isgrounded
The big issue is that it is all part of a terrain piece, and because the terrain piece itself isnt rotated I dont think that is working for me
thats not how that works
terrain colliders support surface normals
ok nvm I was doing it wrong I think
youre also not detecting the rotation of the object youre hitting
yeah I was just using a weird function
but rather their surface normal
you should probably have a bool method to return a true or false
rather than using a global variable for isgrounded...
imo
I mean the biggest issue rn is that you can still stick to walls, but at least they cant really be scaled
👆
yeah but like
yeah
wait what would that even do
they dont have upward movement
they just dont have downward movement either
I think its just the collider getting caught
Hey I am currently running into a weird problem in Visual Studio whereby I keep getting the same error:
"The active document is not part of the open workspace. Not all language features will be available."
and All the codes are unresponsive to Unity infrastructure like not even telling me in Visual Studio if there is any syntax error.
The namespaces are greyed out too.
!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
Can a box collider get stuck overlapping against another box collider??
I mean it depends what you mean by stuck
It almost feels like the bottom of the player box collider is clipping through the top of the stage box collider
and getting stuck
Everything seems like it should be working. Like the ground check is marked and isjumping is unmarked and all that
is this 2d
obviously i was referring to the colliders in use, not the actual game perspective
oh yeah 3d
then it's most likely an issue with your code.
99% with issues like this is something to do with your isgrounded variable if you have one
is the stage seperate from the rest of the ground?
is the layer for the stage set up properly?
I have three lmao. One for the player box collider, one for a boxcast, and one for when bth are touching
Are you spawning the player above the ground or like right next to it
Yeah I have walls on the side and top is grounded boxcollider
Yes
That wouldnt really matter
show code
Being honest I could show code but I feel like thats not gonna really explain the full situation and Im bad at explaining stuff in text
then i guess i can't help you 🤷♂️
Lemme try to explain one problem Im facing
make sure to share the relevant code too
So if Im off the stage and I jump back onto stage with the character box collider up against the side of the stages all the way to the top of the stage then the box cast touches the stage then I enter this weird state of kind of jumping but Im grounded.
A tool for sharing your source code with the world!
Code is extremely messy rn
this is a 3d game?
why are you using a boxcast to check for the ground?
why not a sphere cast or just a normal raycast
presumably your boxcast is too wide
its catching the edge of the stage
What difference would it make? Its only a cast going downwards so it doesnt collide with the side of the stage up at the top when I airdash into it som it doesnt reset my jump
if the boxcast is wide enough then its going to collide with the side of the stage
Catches? is it like a collider?
I know
do you understand what a boxcast is?
it is a raycast
but instead of it being a singular line
its in the "shape" of a box
I know
you should switch to sphere cast and also check for the surface normal of whatever surface its hitting to ensure its flat or less than your slope limit
what difference is a sphere cast going to make if it's still too wide. they just need to reduce how wide the cast volume is
Yeah and this isnt even the issue
The boxcast isnt the only one chekcing if Im grounded
i guess im imagining they are going to reduce the width regardless
Whats truly going to check the ground is both boxcast and the box collider
why
just use the cast
that is literally all you need. provided it is not too wide and doesn't go too far.
I seperated this way because when I jump I want the box collider leaving the ground being the one to deicde when Im "isJumping"

here's a fun fact: you can do that without relying on physics checks because when you initiate the jump you can tell your code that you are no longer grounded
and also when I airdash into the ledge. Its gonna overlap with teh ground box collider. To prevent this I made the boxcast smaller so even if the collider touches the ground ledge. I wont be grounded
WHat happens if I walk off the ledge then?
without jumping?
whatever you tell the code
is your grounded check just in your jump method?
presumably your ground check physics query will handle that
also if you dont want to get grounded during a dash
couldnt you just use an if statement to prevent that happening
given you have states for dashing?
I already solved thiiiiis I was just making a popint about why I use multiple different things to ground check
yeah but your solution doesnt make sense, its overengineered and a bit complex
The issue is yknow what hold on lemme just record it
if im understanding what you are saying correctly
right now you're trying to smash together a decent ground check with an extremely naive one that only works properly in very specific situations. get rid of the bad one and only use the good one
yeah you only need the cast
just make it less wide, switch to sphere and have checks for dashing to prevent yourself from getting grounded mid dash
So if I walk to the ledge and only use the boxcast to detect the ground and since the cast has to be smaller then the collider. That would mean I would be not grounded but still on the top of the stage
getting the size of the cast right takes some trial and error, but it must be sufficiently wide that it determines you are grounded in all correct scenarios, while also not detecting walls as ground when you jump against them.
a collider with a round bottom also helps with being at a ledge (assuming you move with physics) because it can correctly slide off when too far over the edge instead of allowing you to stay stable when even just a single pixel of the bounds is on the ground
Not really liking the idea of sliding off the ledge
i mean its a pretty common solution
does changing the friction cause the slide to be very quick? So it doesnt look like you slid off
its rarely going to be noticable
this is only in fringe cases if players carefully itch themselves towards the edge
most of the time they would walk just off regardless
it's not that you are causing a slow slide from a stable position. it's supposed to prevent stuff like this from being a stable position at all
also wtf when did paint gain the ability to create transparent images
Maybe I could make it like how Smash Melee has the collision box
where its a diamond shape
i mean thats pretty much the same exact concept
except why not just use the built in capsule collider lol
Because its a much steeper angle
i think you are imagining the "sliding" aspect of this wrong here
i suggest you try it with the capsule first
and if you really dont like it try the diamond shape but both are going to be better than the box
paint 3d babyyy
the guy who lead the project is working on the new audacity which looks sick
does someone know a way to make me stop forgetting how to make player movement
Doing it over and over again until you remeber?
alr thx
Question
My assignment asks for AI logs what does that mean?
If anyone has any ideas XD
surely you could ask your instructor?
i wish. Its 1 am now. This is due in 12h and he is impossible to get hold of
I should of asked weeks ago
end of year
half the people here who asked for help were weeks away from finishing projects they have due tommorow lol
pretty common for this time of the year. people realize they put off their important assignments and rush to finish them not realizing that they needed a lot of work to complete their ambitious goals before the end of the semester
im going to assume you need to log what your AI does? If AI here refers to AI agents in your project and now yk LLMs
Yep its actually a log of any chat GPT requests i made
so not what i thought ok
what kind of professor would even let you use ai for this
why even teach you unity to begin with if you can just shake the magic 8 ball hallucination machine
Lol you think he taught me anything?
yeah i mean thats my point lol
worst kind of professor ig
just given up on what they have to teach
I used it quite a bit because i didnt understand what he was talking about (i was in hospital and missed the actual practical)
i think llms in general will just hurt you in the long run when learning
also surprised your college doesnt have mandatory practicals, mine expects you to rise from the dead if you might miss one
So i use LLMS alot to help me understand code
Like break down this line
I let it generate a file then make it break it down into what each line does then use the componats to write my own
That's a better way of using it than most, but LLMs still tend to take the wind out of your sails.
I did a similar thing in my run through college and while I was able to get more insight than some of my fully LLM-dependent colleagues, I was definitely behind where I should have been by the time I was ready to graduate.
I've been playing catch-up since with self-directed study intentionally avoiding LLMs like the plague.
Hey! This might be a super simple question that I am just overlooking in the documentation, but I am coming from Monogame and having some trouble understanding the camera. I am using the MainCamera in orthograpic with sprites rendererd onto 3D meshes. My question is: what exactly is a size of "5" in the camera? My assets are designed for a 480x270 game, how do I ensure my camera is set to show that resolution for the viewport?
orthographic size is half of the height of the camera in world units. if you want pixel perfect rendering then use the pixel perfect camera component
Will pixel perfect camera work fine in a 3D environment as well?
Turns out he expected us to use LLMs
based on the assignment sheet
Using an LLM works... if you're already proficient in coding and can double-check its work. It can save you writing (or hunting down) some boilerplate or simple algorithms.
But you need to know what you're doing, because A. code can go off the rails very quickly, and B. LLMs can only copy what they've seen. ChatGPT is basically a quick reference of StackOverflow that filters out the people who rag on you instead of answering your question, but if you need to do something even remotely unique... or god forbid, you're working with newer versions of stuff with a long history and a lot of deprecated and/or removed features, you're going to need to know how to do research and problem solving yourself.
evil education
Yep which is why my work was supplemented with help from this discord, unity tutorials and the unity documentation
And I have a background in C and Java programming so I could tell when it was feeding me bullshit
Nice, that's a good background to have.
I didn’t blanket copy and paste
I copied 2 functions because they worked and I understood that they would work
I need to make a statement in my write up that I understand that I copied that bit and I won’t be marked on those functions
But it’s 2 functions out of hundreds
can someone teach me on where to start, I just started using unity not too long ago
!learn
:teacher: Unity Learn ↗
Over 750 hours of free live and on-demand learning content for all levels of experience!
thanks
C# is pretty funny, coming from Swift it really does feel like a Java-fied version of it. If only I could drive Unity directly from Swift...
is it possible to add a new mixer track through code?
Does C# have optionals?
Nullable is the equivalent i think
It’s slightly new-ish and you gotta do some stuff to make it work with unity iirc
But also the shorthand where you do like foo?.bar.Thing() isn’t supported in Unity because of reasons google will probably explain better than me
Rip
So like, basically not
That’s a shame
hey, i'm doing a board game and i'm having questions about how to code the board, some part of it can rotate but i need to keep the same direction, also some paths are active and some are not, how would you guys code a board like this ?
It’s not supported only for gameObjects and types deriving from UnityObject. You can write regular plain old classes that use the ? Operator. For the unity stuff you just do a normal null check
Using the new input system, what's the simplest way to make a sprint? I have the movement, I just can't figure out the way to make it so that when I hold it it sprints and when I let go it stops.
{
sprintInput = value.isPressed;
}```
This is what I was using to get the button input
How do I go about making it so that the capsule collider doesnt slide off the ledge?
I normally had it as no friction material
Hey folks. I have this gorgeous broccoli in my scene, and I would like an animation where it flashes from normal color to a more white color in a loop. The basic gist of it is the crop is expiring and will soon disappear, thus it flashes.
I'm trying to use the animation system to do that but changing the base color doesn't do crap. Any advice ?
is it worth learning coding with Unity for game making. or just quicker just to use the tools instead
What tools are you thinking of? Ultimately coding is the tool for making games, anything else won't get you very far
if you want to make games in unity you need to know how to code or work with someone that does
so learning basic code is a need really?
the tools already provided, like the blueprint tool thingo
visual scripting
yeah
you can try starting off with that if it helps you get comfortable with programming but a majority of people that release stuff end up going from it to direct programming
It's good enough for very simple game logic but it becomes unwieldy very quickly
yeah ok fair enough. Ill learn from the Unity Learn site about coding before doing anything then
oh ok
Hi, when I click "remove assets from project", on a asset doesn't it get removed. And when I try to add a asset doesnt it get added. It just download to the package manager that works
What? Are you talking about an asset or a package?
assets that I downloaded from the unity website
How did you add them. Through unitypackage, or package manager?
When you downloaded them manually, I guess unitypackage
so first, thats not a code question, so Unity-talk would be better. But as we are here. Do you get any errors when trying to import them?
Oh sorry, no, I just see a prepering assets loading bar, and then it disappears
And usally "import x.x.x to project" get changed to in project or something, but that doesnt happen either
But you are doing it through Assets => Import Unity Package?
In Package Manager, is their tabs like Unity register, Services, Built-in and also My Assets.
I go to My assets, and then click on my asset that I have downloaded from the unity website, through the package manager.
and then I click Import 1.1.1 to project
and then usally "Import 1.1.1 to project" changes to "In project", but that doesnt happend, so something is bugged iguess
Sounds like. And again. clearing the console and hitting "import" does not fire any errors in console?
nope, nothing in the console 😢
Is it possible to clear caches or something in unity
I did try to restart my computer but that didnt fix it
You could check, if there is something in your packagecache with that bundle namespace in it and remove it.
Okey, how can I do that?
Ehh, should we change discord channel to #💻┃unity-talk maybe?
Is it possible to apply a sort of mask to an asset ? I have this asset with a weird color/palette and i can't change the color like I want to. If I change the material to a white material, the object becomes red :/
I'd like to have the object to go from normal color to white and I have no idea how
I've seen some tutorials w/visual studio community that have this neat little autofill, but that doesn't seem to be the case for visual studio code which kinda sucks
is there an addon/plugin that implements this?
probably just best to switch to community, but I'm curious
you mean autocompletion? Or what are you referring to?
mhm
only works for existing variables and a couple other things in visual studio code
!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
yeah I have those plugins installed already, guess it's just better to switch to community
Well, I am using VS Code with that autocompletion. The screenshot I just took from it. So I guess, there is some issue in your vscode setup. Not sure, what methods or fields you are missing
guys how can i learn event system ? i tried so hard i know what it does but i cant understand how it actually works
how to use it and all
? What is your actual issue? And how is it code related in your case?
i don't know bro , i cant understand how to use it . my bro said you have to learn it if you want to make your own game
What do you want to achieve? Get some effort in explaining what you are struggling with. Just saying, I dont know how it works does not help anyone to help you
i want to make a reload system for my gun and health bars and shooting mechanism
And you dont know how the EventSystem for UI works or how Events in code work?
have you installed .net via the .net install tool (and then restarted)
yea i dont
that was an "A or B" question
is your issue with the EventSystem component, or the event c# feature, or events as a pattern
yeah figured that was the issue
that's the ticket
i wanna add post processing through unity's post processing package but effects doesn work. i searched a bit and find out that it is because of URP. how can i switch back to the built in one
URP also has post processing
yes but i want to add to 1 specific layer
and no i dont wanna do camera stacking it couse too much performance
as i know, making to specific things only be done by using colliders in volume component
Can you provide a path script for the latest version of unity?
for what?
For 2D platform
yeh, you are right. Camera stacking would probably the only option to get different postprocessing with the same visuals in place. Volumes are just like volumetric areas that turn on and off post processing. You could try to add the post processing to a rendertexture tho. But that dpeends on the effect I guess
not a code question
Can we know where the "collision" happened with a ontriggerenter ?
no, because that basically doesn't exist
there's no collision/contact point
you can work it out externally probably
there is Physics/Collider.ClosestPoint
What is Render pipeline?
not a code question
Aah sorry :D
how can i fix this?
The light in my scene is not being rendered, might be overlooking something trivial but can't figure it out rn
The light you have in your scene is a baked light so only static (the checkmark top right) objects have any effect
I had it as Realtime before and it doesn't change anything sadly
Just to be sure you understand the light here is a directional light so it works like a sun does where position doesn't matter only rotation
Also have you tried messing with intensity
yes, to both things :/
I've been trying around with a bunch of different ways of casting light in the scene and none of it is really working
Just checking this isnt a 2d scene is it? (Not sure if it'd change much but just checking)
it shouldn't be, I don't think. It was created in a 2d project if that influences it in any way
It might have you check to ensure unity's 3d assets were installed
how would I do that?
(not really a thing - 2d vs 3d projects simply have some different defaults and packages)
Sorry wrong wording meant project, im tired only got 2 hours of sleep last night
not a code question
might be your materials being unlit
Didn't even notice where we were whoops
eh, it happens. happens to me a lot too lol
ah sry I didn't see the rendering forum
checking this
looks like this so I think it should be fine
(as mentioned above) 2d and 3d projects have some different settings, if you don't have much work done you could consider moving to a new 3d project to make some stuff easier in the future
there's a 3d "feature" that comes installed with that iirc
At the top theres a dropdown name Asset store if you click it then My Assets it'll open the package manager unity asset is a tab in it
anyways i don't really do 3d or lighting stuff, so can't really help anyways
it's a fairly big project already so migrating it would be difficult, is there a way to import this feature into this project?
not the right one
in package manager, check for the 3d feature
It open to the same window just a different tab
i don't remember which tab it's in, and mightve changed in unity 6 anyways
Any help guys?
these two?
mmm not sure, i don't do 3d
make sure you have the press & release interaction set
I also dont lol, so no clue
doesn't sound like a code question
Visual scripting is more of a crux than it seems, its like learning all the unique rules that a language follows but writting all its words in your native language.
As in separately?
no, there's an interaction type that's called "press & release"
Aight, lemme have a look again
Hello guys should i use Transform.rotate to create a shake effect for a camera ?
Do you want to rotate a transform?
you could but theres better ways of doing it
If so, Transform.Rotate is a way to do that
imo the simplest and easiest way to create camera shake is using cinemachine
obligatory: use cinemachine
oh Yes ? i'v been trying some stuff but it have a weird result .
this might be exactly what you want
To be honest i'd like to script it
Okay Thank you !
then i would use tweening
personally
I'm using shake effect though changing a current local position of camera...
It makes better effect than just changing a rotation.
but theres also virtually no reason to not use cinemachine
Heya, is this the right way to add a collider to my player? using the polygon collider and adjusting edges manually?
Thanks 🙂
Yes , I can imagine how i would do that but I would like to focus more on C# :)
I would prefer a simpler circle collider
i mean its always great to want to learn how to do these things on your own
but also theres no reason to choose a worse option once you do learn it lol
Tried but the edges don't match good, it sort of floats because the bottom of my character is not a circle it's a straight line
Then try a box collider
yeah a box collider is probably the best option here
since the top and bottom of your character are flat
then its the sides which have an angle so the box collider won't fit perfectly
if i hit something diagonally it won't work properly
Why does it need to fit perfectly
it will work fine lol
you dont need a perfectly flush collider
going for a precision platformer
i think you are slightly overthinking the important of those 2 corners of the collider not being perfectly flush
even for a precision platformer its more than enough
probably just a beginner want it to be smooth though
If you use rigidbody you can freese rotation for some axes but I am not sure if that's good optimised.
Yeah you'r right , but isnt animation a problem like imagine i'am moving my camera and the animation play is this gonna adapt himself automatically ?
What, like Celeste?
you can worry about this later
cinemachine doesnt use animations for the camera shakes
its all realtime
There is very little practical reason for your hitbox to match your character exactly
Oh
is that the actual hitbox they use? ooh nice thanks
Yes
sorry guys i'm just starting so yeah though i needed it to align better
it doesn't need to be exact, it just needs to feel nice
most important part
if anything, slightly smaller is better
i'll try box collider then thnank you guys
makes sense what you are saying yeah, i'm overthinking 🙂
love ya!
i Think my camera have a cinemachine camera ,
Okay i'am gonna check how this work Thanks for the help
Hey guys i have a question about making level scenes
So would it be a wise idea to organize level scenes by build index or is there a better scene specific way to like find the "next" level scene, because what i currently do is add one to the current build index and then that becomes the next unlocked level
That's fine
why the fonts are not generate correctly.
Not a code question
what us the channel thet i should go.
you also did not say what the issue was, as i asked previously
and don't crosspost please
use #💻┃unity-talk as you did before
im having probs with delegate pattern in unity
ok sorry
: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
then? i can't understand to use it. i made several scripts but this .... i cant understand to impliment
a delegate is a type that can contain any method of the same compatible type
yea i know but im having hard time using it in my script
to put it simply they let you pass a function like you do a variable
well does your script require you to use delegates?
what are you aiming to accomplish
i want to make the reloading , shooting etc mechanism for my FPS shooter
so what does that have to do with delegates
i want to learn it to make my game bro , like game over pop-up etc.
delegates aren't necessary for that
it's one thing you could use, but definitely not the only way
the point we are trying to make is that you dont need delegates to do that
you could but also why
event system?
and yet you've still not actually said what precisely you are struggling with
i want to make an interactive textbox in my Visual Novel game in Unity. If the player clicks it and type a code, it should be correct and the story continues. If the code is incorrect, it should show an error screen. Can anyone help me with this?
...so what does that have to do with delegates
also pretty sure a lot of delegates can trigger garbage collection so relying on them too much isnt ideal either
haven't you asked about this stuff before
you simply don't need it
someone said i have to learn delegates and event system to make my games further and my reload functions too
make it work, don't worry about the specific pattern you use
oh
who is this someone
that person is wrong
you should learn them, because they are an additional tool in your toolbox
this "someone" person seems to be giving a lot of people in this server bad tips
but it is not necessary
dear god that code is terrifying
Thanks 🥲
Undertale code moment
Do you know what delegates and events even are
scene09events... is there scene0-1events also?!
damnnnnnnnnnn , is that how i have to write my code? (im ded seeing this )
bro you still haven't fixed this...?
please tell me you dont have seperate thousand something lines classes for each scene @glass summit
because you should probably fix that before you work on anything else
No it's for my game
i know delegates but not events
events are just one usecase of delegates
yea ik but im just saying
I don't get paid enough for this
i want to learn event system
so you know delegates but are somehow struggling with delegates? it can't be both. you either know how they work or you are struggling with them
sure, but don't learn under the excuse of "i need it for X system"
No I use coroutines that are triggered based on event position
events == delegates??
Events use delegates
You, yourself, have said that you were struggling with delegates. But now you say you know them?
events are delegates, yes. they are just a special kind of multi cast delegate that can only be invoked by the object that actually owns it
If your issue was events, you should have asked about events to start with
Can anyone help me? My safe code does not seem to work
Or it could possibly be something related to the project panel
mate, you can't drop 1400+ lines of code and say "it doesn't work". you need to provide details and actually say which part is not working
again. if you fix your code to not be repetitive and unreadable as hell, it will make it much easier for yourself and us to fix other problems
take some goddamn time to make your life easier instead of powering through with the content
I'm sorry but I am just not going to go through 1500 lines of code and try to make something out of it
only Jesus can help you with that code 🙏
i didnt know bro they were same or whatever , thats why i txt here to take help from u guys
they arent the same
events are delegates
lol
so I wanted to make an interactive puzzle, if a 3 numbered pin is entered correct, the story continues. If not, there would be an error screen
but not all delegates are events
I mean before you got that answer, you said you needed help with delegates, then when asked about it you said you knew delegates but struggled with events
you've already had a bug that you've asked here about, caused by this layout being unmaintainable, and you will encounter more
you havent said anything new or beneficial
That sounds like a single if statement. Why is there 1,402 more lines than that
what else am I supposed to do XD
so what, you want someone to design this for you? or are you actually having an issue with this monstrosity you pasted? because if it's the latter, you need to say where the issue is instead of assuming people are going to read your 1400 lines of code to deduce what the fuck you are on about
for starters you should probably refactor/rewrite your code
yea , i have just learnt the delegates but i dont know to use events , and im confused
and use a different approach
the issue is, idk which lines of code i need to take a look at
you wrote the code.
then read your own code instead of expecting other people to spend hours trying to deduce wtf it is doing and where to even look
how do you not know which part is responsible for handling the safe
An event is basically a list of functions that all get run when you Invoke the event. So, you have the object with the event that knows absolutely nothing about the stuff that it's calling, it just sends a message like "Hey anyone who cares, I'm doing this thing" and every function subscribed (added) to the event runs
And since you wrote it, you are the leading expert on whatever the hell this is. If you don't even know where to look, how are we with zero context supposed to pick it out of two thousand lines of out-of-context code we didn't write
you also need to seriously consider switching to a more data driven approach for your game, at what point do you write 50 something coroutines for dialogue in a row before stopping and realising there has to be a more efficient approach
It's common for beginners because they don't realise this fact at the start
We know from experience that it's the wrong design
Coroutine ThirtyEight in line 1089 and public void CheckCode at line 1376
and ive told them multiple times
i get it, but any video tutorial for this ?
or anything which can help me with this?
Ah well if noobdev doesn't want to learn then too bad I guess
theres plenty of videos on events
What do we know with our many years of experience 😜
no such thing as cost sunk fallacy in game development, never commit to a flimsy foundation
Why the hell is it named Coroutine ThirtyEight
@glass summit seriously, fix your goddamn code. i'm tired of going through it at this point.
lol i was watching this just now the switch here to get help
What am i supposed to do?
Your code seems scientifically engineered to be impenetrable to anyone
like i said previously, switch to a data driven approach
ive told you thrice at this point
At this point I would suggest contacting a Priest
Could you repeat? I must've forgot
Scroll up bud
bro was not listening
anyways ill be nice and say it again
separate your story content into external data files and build a simple interpreter that reads them, with a state manager component as a centralized storage for states
rather than hardcoding your dialogue directly into 50 something coroutines per scene
thing is, each line different events happen in game
it's not just abt changing the dialogue
yes...?
do you think you will lose those capabilities if you switch to a data driven approach?
if anything using data files lets you manage this in a far easier way
heres an example
i described it very briefly here, when you said you didn't know how to make it work with a loop
#💻┃code-beginner message
you never followed up
scene_intro:
character: "Me"
text: "Use a data driven approach for your visual novel"
expression: surprised
choice:
- "No" -> scene_wronganswer
- "Youre right" -> scene_goodanswer```
then you would have some sort of interpreter that can emit the events
an approach with less overhead (on designing the schema and interpreter) could just be a list of tuples for stuff to do
hell, you could have a delegate in there for event-specific actions
I don't understand what you mean by this...
Made like 5 small games and not one has a single code larger than 500 lines, nor would i recommend handling any sort of storyline like this there's story trees that allow for different endings and reactions that are much easier than hard writing it in code
which part, specifically?
can't you do something similar to what you had a few lines above your // SHOW SAFE INPUT line? You wait for the text length to reach some length
if all you want to do is wait for the user to type the code then you can check/wait again with conditions and something happening?
obviously it would be better if you just scrapped that thing entirely and remade it in a much better way, but if you want to keep doing what you're doing then it might work
the whole statement
you don't understand how loops work?
no
then you should at least understand that each iteration is (or can be) different
You're cooked bro , you're above human consciousness 🗣️
Name fits 🤣 (unless i miss read this)
You should rename yourself with "Enlightened being"
do you seriously not understand this
a loop can count up or go through a list
you should learn a bit more C# before you go around to making an entire game
loops are very useful and will help in a million ways when you understand them and use them properly
wait isn't a loop like getting to repeat an action multiple times?
Why does this gap exist?
You can cleary see my box collider green lines it should be further down so it doesn't create a gap with the floor collider but there is still this gap
any idea? 🙂
not a code question
not sure, that's why i was asking
have you seen the for keyword before
which space should I use? new to discord channel
no
alright, so you definitely don't understand loops. consider go learning them
@still oyster just fyi, in the future questions like that would go in #🖱️┃input-system
updatedPublicData = new()
{
{ nameof(PublicPlayerKeys.UserID), await GenerateUserID(context, gameApiClient) },
{ nameof(PublicPlayerKeys.Name), $"User_{updatedPublicData[nameof(PublicPlayerKeys.UserID)]}" },
{ nameof(PublicPlayerKeys.Lv), (byte)1 },
{ nameof(PublicPlayerKeys.Exp), 0 }
};```
this is just a dictionary, what i want to ask is , dictionary cannot guarantee sequence even in this kind of declaration?
there's nothing in the standard dictionary implementation that guarantees order
so sure because you declared it in that way it might be in the same order you declared it but there's no guarantee
you shouldn't count on it basically
welp i guess i can only use tryget
if you declare it like that you can guarantee those keys will exist
just the order of them may not be the same
this is the condition where userID is guaranteed not exist
yeah then tryget is your friend
that's definitely wrong
i can somehow feel it lol
even in this kind of declaration
technically that's a definition, not a declaration.
the kind of definition you use doesn't affect whether or not a sequence is guaranteed, what matters is the implementation. no matter how you define the contents, if you're using Dictionary (and not a subclass that implements it differently, for example) then you don't a guarantee of order.
elements are just the contents of the dictionary, you can't "generate on" an element
does mono have OrderedDictionary or is that .NET exclusive
I can't really think of a usecase of it
it does not afaik
i'm not sure what this means as chris said the term "generate" doesn't really apply to dictionaries
mono is a runtime, .net (in this context) is a library
and mono does support a version of .NET that has OrderedDictionary
OrderedDictionary would be part of the .NET standard library
System.Collections.Specialized iirc
which comes part in parcel with the .NET runtime
there'd probably be issues using the .NET standard library with mono runtime
no
that's.. not how stuff works
but the generic OrderedDictionary is on newer versions of .NET so unity doesn't have that
yes unity uses .NET Standard
which includes Systems.Collections
and they don't have OrderedDictionary because they haven't updated their implementation to support all the new C# stuff
i think this should ease the tension lol
updatedPublicData.Add(nameof(PublicPlayerKeys.UserID), await GenerateUserID(context, gameApiClient));
updatedPublicData.Add(nameof(PublicPlayerKeys.Name), $"User_{updatedPublicData[nameof(PublicPlayerKeys.UserID)]}");
updatedPublicData.Add(nameof(PublicPlayerKeys.Lv), (byte)1);
updatedPublicData.Add(nameof(PublicPlayerKeys.Exp), 0);```
they do have OrderedDictionary
because im adding it now, assume if the first add is successfully executed, second add should be able to refer to first one
really? i couldn't find any docs for it (i'm aware majority of the docs would just be to use microsoft)
or any usage of it
again, the nongeneric version is available, the generic version is not
ah you said generic here not just general OrderedDictionary
yep that's where i've got the mixup
the generic stuff isn't in .net standard which makes sense why unity wouldn't have it
they'd have to add the system.collections library or reimplement
i think tryadd should be better lol
if you add something to a dictionary and you don't modify it after to remove the thing you added
you should be able to access the thing you just added
kinda confused tbh. ive tried looking this up before, and i distinctly remember finding just results with only string keys (and object values)
maybe that was a different class...
you mean the generic one?
no, the generic one takes generic keys too
oh i only just understood what the issue was here lol
doesn't this work? iirc the collection initializer just calls Add in sequence
my memory, to be concise - i remember the class being different
oh
yes it calls AddRange which is just a loop over the input with each being an Add
oops that's the generic one
in fact, i just realized tryadd maybe more suitable to my method
this function is a validation of account data, what it does :
- check if certain field exists or not
- if yes, ignore it , just let it be
- if no, generate the field with default data
the docs for the collection initializers don't mention addrange at all
yep thats just tryadd
no, it'd be Add, it errors
it'd be a thousand times easier for you to just generate the userid outside of the dictionary
yeah
that'd also be true
i just isolated userID
but tbh, im pretty sure this just works
no matter on which conditions, i will check userID first
you don't have existing fields anyways
you're overwriting the entire dictionary
did you try your code before asking at all?
absolutely right i'm just dazed looks like the docs do explicitly say for a dictionary it just calls add
it doesnt work i afraid
updatedPublicData = new()
{
{ nameof(PublicPlayerKeys.UserID), await GenerateUserID(context, gameApiClient) },
{ nameof(PublicPlayerKeys.Name), $"User_{updatedPublicData[nameof(PublicPlayerKeys.UserID)]}" },
{ nameof(PublicPlayerKeys.Lv), (byte)1 },
{ nameof(PublicPlayerKeys.Exp), 0 },
};```
went back to the old way
i gonna do add instead
its much safer
yep, if its add it will be working smoothly , sry guys and ty 👍
ah right, because updatedPublicData isn't actually set to that dictionary yet
something like this would make it more obvious
How can I access the alpha of a color in an image component of something in the UI? I want to make a visual effect (as a PNG image in the UI canvas) set its alpha value to 255 when losing health (and also make the same visual effect lose alpha value in update every frame if it's over 0 but I can guess how to do that)
In a script I mean
The method I'm planning to use is making a function in a script attached to the visual effect image object and make other objects call that function whenever a damage conditional is fulfilled
But I'm not sure if I can access the alpha variable in the color of the Image component in the script, couldn't find that in the documentation
image.color
Thanks!
I have been following this tutorial, https://youtu.be/zbBwKMRyavE?si=QZM6cZLYtc8Ap_r_ and have tried to recreate it. However at timestamp 8:24 when the code is run, I get a memory leak due to allocation whereas the code in the tutorial runs fine. I have referred to his github and cross checked my code. I am using Unity 6 and a built-in 3d template. What appears is a single particle and no other particle. For reference, my specs are rtx 5070, 32 gb of ram and ryzen 5 7500f
Got really curious about Realtime Fluid Simulations and I put together this video that will hopefully help you understand how it all works, the core technology used is Smoothed Particle Hydrodynamics, and everything is written from scratch in Unity using C# and Compute Shaders.
If this video gains some interest I'll release a second part about ...
You'll need to provide some more details. How do you know it's a leak? Do you get any errors? Share your 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 is not an error, but a warning.
But anyway, did you try doing what it suggests?
Select one with the callstack and show it's details.
Found 1 leak(s) from callstack:
0x000001cbef3ee283 (Mono JIT Code) UnityEngine.ComputeBuffer:.ctor (int,int)
0x000001cbef3eb773 (Mono JIT Code) SPH:Awake () (at C:/Users/UK202/Fluid 1/Assets/Scripts/SPH.cs:63)
0x000001cc9b1ff3b8 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007ffb0cc86bfe (mono-2.0-bdwgc) mono_jit_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/mini/mini-runtime.c:3445)
0x00007ffb0cbc8984 (mono-2.0-bdwgc) do_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3068)
0x00007ffb0cbc8a70 (mono-2.0-bdwgc) mono_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3115)
0x00007ffb152d30f4 (Unity) scripting_method_invoke
0x00007ffb152d9fb3 (Unity) ScriptingInvocation::Invoke
0x00007ffb152da09e (Unity) ScriptingInvocation::InvokeChecked
0x00007ffb15311858 (Unity) SerializableManagedRef::CallMethod
0x00007ffb151e680b (Unity) MonoBehaviour::CallAwake
0x00007ffb151e4ee6 (Unity) MonoBehaviour::AddToManager
0x00007ffb151e590f (Unity) MonoBehaviour::AwakeFromLoad
0x00007ffb15344368 (Unity) AwakeFromLoadQueue::InvokePersistentManagerAwake
0x00007ffb15348e8a (Unity) AwakeFromLoadQueue::PersistentManagerSingleQueueAwakeFromLoad
0x00007ffb15348bad (Unity) AwakeFromLoadQueue::PersistentManagerAwakeFromLoad_NoChecks
0x00007ffb15276670 (Unity) LoadSceneOperation::CompleteAwakeSequence
0x00007ffb15276f5d (Unity) LoadSceneOperation::CompletePreloadManagerLoadSceneEditor
0x00007ffb15277cc1 (Unity) LoadSceneOperation::IntegrateMainThread
this is what it gives
_particlesBuffer = new ComputeBuffer(totalParticles, 44);
apparently this line is the issue
_argsBuffer = new ComputeBuffer(1, args.Length * sizeof(uint), ComputeBufferType.IndirectArguments);
as well as this one
is it something wrong with the code or unity version?
wait i have fixed it
it was to do with the order of the items in the struct
im like a very beginner level dev, and ive just started my first year in uni
so i dont know much but im learning
if it's alignment as i suspect, i could probably explain the issue
what's the struct in question?
it is a particle struct
yeah, i'm asking about what's actually in the struct
[System.Serializable]
[StructLayout(LayoutKind.Sequential, Size = 44)]
public struct Particle {
public float pressure;
public float density;
public Vector3 currentForce;
public Vector3 velocity;
public Vector3 position;
}
it also seems like _argsBuffer could be "wrong", in a way? though i'm not familiar with ComputeBuffer so maybe it's structured in a way that that's necessary
hmm, nothing there would have different alignment afaict
it's just 11 floats, 4 bytes each
i find it weird tbh
Perhaps changing the order just fixed the issue temporarily.
It could be something with the buffer lifetime.
I mean, it must be.
hmm yes a beginner issue for sure /s
the people hate the forums ig
yes, if it's complaining about a leak, then the problem is that you aren't freeing a buffer
I would not expect this to have anything to do with struct layout
you need to call Dispose() on the buffer when you're done with it
This is just pointing out where you allocated something that you forgot to dispose of later
When the buffer is allocated, Unity makes a note of it (and remembers the current callstack)
It can check later (probably when it's winding down from Play Mode) if any of these allocations weren't freed
This isn't a fatal problem, but it would be best to neatly dispose of the buffer when you're done with it
so then where would be the right place to call dispose?
(especially if you're only "leaking" it when the game quits)
it leaks during play mode
as in, when you exit play mode, yeah
You can dispose of it when the component that's managing the fluid system is destroyed
of course, you shouldn't try to use the compute buffer after disposing of it
no, it reports a leak as soon as i hit play
the sim does not run i.e. work
ah
this is what im seeing
You are not getting a message that says "GarbageCollector disposing of GraphicsBuffer. Please use GraphicsBuffer.Release() or .Dispose() to manually release the buffer. To see the stack trace where the leaked resource was allocated, set the UnsafeUtility LeakDetectionMode to EnabledWithStackTrace.", correct?
yep
er, that was GraphicsBuffer, but same idea
That gets logged in the destructor of the ComputeBuffer if you didn't dispose of it yourself first
However, it only gets logged if native leak detection is disabled, and native leak detection is what's printing that information to your console
so that's not surprising, actually
I wonder if you're getting a warning for the last sessions's compute buffer
this is especially relevant if you've turned off the enter-play-mode Domain Reload (so that entering play mode is faster)
ah i seee
although, either way, you'd wind up seeing a message as you enter play mode
(assuming that it's checking for native leaks upon reentering play mode)
That's going to be unrelated to the leak warning.
yea
A tool for sharing your source code with the world!
this is my code
there should be a cs file and a compute file
wait its working again lmao
thank you so much for the help @teal viper @naive pawn @swift crag
I want to make the boxcast half the length of my capsule collider
I managed to make it go half way down
but I can't anything else past this idk what to do
Height
well if you are moving it down and its half the height then you need to move it down 50% more
so it doesnt go half way down
if you need it to go all the way down
in fact what are you trying to do
making the boxcast reach the same length as the capsule collider
then Ill add a very small value like 0.1f to it
so it extends past it
nevermind
start the boxcast at the bottom of the capsule plus half the box height upward, use half the capsule height as the box size, and cast straight down 0.1f
since boxcasts originate from the center of the box iirc
Hey, does anybody where can i found some help?
just ask the question, as specific as possible. when someone sees it they'll help if they know
On this channel you say?
On whichever channel is the most relevant to the question
as written in the channel section "Ask questions and discuss anything related to beginner coding concepts in Unity" bro
omg hi digiholic! maybe u know the answer to my question
Ok, thx i will keep that touch. 😉
hi all, I was wondering how to interpret the time that returns from animationClip.length
i noticed my clip time says about 1:20 but the value returned is 1.875 🤔
How are you getting the value exactly?
simply animationClip.length , from an [SerializeField] animationClip; 🤷♂️
The source take says 24 FPS but I don't know how that would matter.
100 frames should be 2.4 secs then 🤔
Oh, no! It's from frame 57 to 102. Unity editor things
45 frames
Ah so you didnt take into account that it starts at 57
Problem solved?
I guess length doesnt care about the start/end frame
Hmm wait no thats backwards
Well I actually am doing all this, because AnimationClipPlayable.GetDuration() just returns the full source take duration.
So, two clips from the same source, totally different start/end, yield the exact same time.
It does, I just did another clip from same source take, from 0 frame to 102 frame. Different time (4.25 seconds)
Whats the actual issue you are solving?
As in, what do you need the exact duration for
@edgy sinew have you changed the speed of the playable?
No I don't think so. And it's important for me to know when a clip might end
Can someone tell me what is the script of Opening & Close Credits Panel instead of using Scroll Bar? I'm so pissed off by ChatGPT now.
the script of "opening and close credits panel" is whatever script you wrote to do that...
theres no premade rolling credits template of any kind iirc
@verbal dome Interestingly at runtime the clip seems to end perfectly, at "1.875", I think it's the Inspector value that shows up at the bottom that is skewed.
For ease of view, image is of the other clip for which animationClip.length shows 4.25 (but the Inspector preview thing only goes to 4:05.)
Is this part of animations?
Well, yes. For some [SerializeField] animationClip or any animationClip in general,
animationClip.length returns a different value than what the Inspector preview says at the bottom.
And using .GetDuration() on an AnimationClipPlayable seems to return the source take length,
not the length of the clip you've configured by moving the Start and End frames
I need help, my animation does not save the position, I tab out on the animator tab and go into the animation again and the positions are reset. The values in the object position and rotation in the animation editor do change, then reset when I go out of the tab
Not a code question, but are you sure you had Record enabled when you did the changes?
Oh, I never had that on... I never needed to have it enabled until now I guess so thats why I ignored that.
Were you directly modifying the position values in the animation window or were you moving objects around?
moving them around
Yeah that needs to be recorded
Okay, thank you!
also is this the right channel? I didn't know as "animations" were in the "Artist Tools" section and you guys were fixing other people's animation problems so I was confused and decided to try here.
Your question belongs in animation
The other person was asking more code-related stuff so that goes here
Either channel woulda been fine for their question tbh
Ok, Thanks!
guys can somone who litlle bit knows in unity help me with somthing im beginner i went to void and i dont know how to get out of it i ask chatgpt and he didnt know wha i was saying
Yeah i dont think anyone knows what this void is
i had all this in my screen and now its all gone
!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
now its only that 😭
You opened a different scene
In the project tab go to Scenes and reopen the SampleScene if stuff if missing theres nothing we can do its lost for good
Also not a code question
omg thank u soo much
When I try to use "rigidBody.AddForce(Vector2.up * speedVariable * Time.deltaTime);" to make a bullet get speed on spawn it just goes upwards instead of inheriting the rotation of its parent object. Is the problem in that line?
I'm following a tutorial that uses the old input manager. How can I take what they show me and apply it to the new input system?
Maybe you want to add relative force instead, which is a function
What bawsi said, but also Time.deltaTime should not be used for one-shot forces like that
Especially if you call it from Update/LateUpdate, the bullet's initial speed will depend on your framerate
Thanks! It works now! But if i remove Time.deltaTime it won't move.
Also the line is at void Start
Oh nevermind it was the mass on the rigidbody, changed it accidentally
The enemy works as intended now
I feel like the bullets are speeding/slowing a bit alongside the fly movement maybe??? I can leave it like that but I would also like to know how can I prevent that from happening
Are you still using deltaTime or no?
nope
You are probably using a 3D position to set the direction here
You should ignore the Z coordinate (depth)
But I'm just speculating, maybe show more of your code
This is attached to the invisible object that shoots bullets which is a child object of the fly
Oh
There it is, deltaTime
Hi, I am updating an asset to the latest unity api and am not sure whether these are just drop in replacements or if there's some more work to be done?
those are drop-in, they were just renamed
like velocity to linearVelocity
Thanks!
and technically fixed to be more accurate, drag would be proportional to the square of the velocity, but here it's proportional to velocity
how do i activate the hint that suggest word you wanna write like gameobject or ray
!vscode
If your IDE is not underlining errors in red or autocompleting code,
please configure it using the link below:
tried that didnt work
If your IDE isn't providing autocomplete suggestions or underlining errors in red, then it needs to be configured.
still not woking mabye i shuld reinstall
what modules are nessesary
Visual studio and whatever platforms you plan on developing for. Note, you can install modules later if needed
Hmm should I change the velocity? using UnityEngine;
public class PlayerMovement : MonoBehaviour
{
public float speed;
public float jump;
private float Move;
public Rigidbody2D rb;
void Start()
{
}
void Update()
{
Move = Input.GetAxis("Horizontal");
rb.velocity = new Vector2(speed * Move, rb.velocity.y);
if(Input.GetButtonDown("Jump"))
{
rb.AddForce(new Vector2(rb.velocity.x, jump));
}
}
}
How are you supposed to figure out what asmdef you need to reference in order to use something?
E.g., I need this:
https://docs.unity3d.com/6000.3/Documentation/ScriptReference/UnityEngine.XRModule.html
But I don't see any mentions of asmdefs anywhere :/
It could be implemented at runtime, like this? And plug it to some UI element for player inputs/interactions 🤔 if it is what you meant by changing asmdefs
using UnityEngine;
using UnityEngine.InputSystem;
public class KeyRemapExample : MonoBehaviour
{
public InputAction jumpAction;
private void Awake()
{
// Create the action if not assigned via Inspector
if (jumpAction == null)
{
jumpAction = new InputAction("Jump", InputActionType.Button);
jumpAction.AddBinding("<Keyboard>/space"); // Default binding
}
}
private void OnEnable()
{
jumpAction.Enable();
}
private void Start()
{
// Override the binding at runtime
jumpAction.ApplyBindingOverride("<Keyboard>/enter");
Debug.Log("Jump key changed to Enter");
}
}
wym
Eh eh, I know code-fu
asmdef is a unity feature unrelated to ui, here:
https://docs.unity3d.com/6000.3/Documentation/Manual/assembly-definition-files.html
Im trying to do this cube 2D game https://www.youtube.com/watch?v=6xn0Sokihdc
More videos coming soon!
Intro 00:00
Setup 00:22
Creating Variables 03:12
Move function 03:58
Jump function 05:56
Inspector 06:33
Ground Check 07:20
Outro 10:44
Main Channel: https://www.youtube.com/c/bblakeyyy
Patreon with fully explained c# scripts:
https://www.patreon.com/BlakeyGames
NEW SERVER LINK: https://discord.gg/cyskvvyDeH
Silhou...
Oww so "asmdef" was for assemblies and not a mistyping of "asdf" for the keybindings. OK, so it's for optimization 🤔
you wanna use .linearVelocity instead of .velocity
Aah okay
its a change to unity newer than that tutorial
Aah okay
asmdefs are mostly used for code separation, but yes, they could speed up reloads a bit.
I am updating a vr asset that requires the namespace I sent above but I can't figure out what asmdef it belongs to.
Ty for help!
I just made sure I have the necessary packages installed too.
What exactly am I doing wrong?
What error message do you have? Printscreen? Is it at compile-time or runtime? Did you add "UnityEngine.XRModule" as assembly reference? I am new to Unity3d 😅
that's the thing, it's not an available asm ref :/
What version of Unity are you using?
6.3 lts
It cannot find the assembly "UnityEngine.XRModule.dll" for some reason 🤔
maybe, not sure tbh
The thing is, it's not even an asmdef ref that I am missing.
I just tried creating an empty script in the assets dir and I can't access it from there either.
You could see if it's possible to manually add the dll, with the + button on the top-right of the screen 🤔
That's how I got to the window you see in that picture.
https://paste.ofcode.org/3a3iiwzcfUDui68yvD5XWaV
is this the correct way to do it?
anyone knows why I cant change the mat of the eyebrows
Can you locate and confirm the presence of "UnityEngine.XRModule.dll" on your file system? 32-bit? 64-bit? Access rights? 🤔
I am on linux and not seeing an so file is a bit odd, maybe this package doesn't support linux or something?
and I can't even switch to windows as the "module is not loaded", even tho I did install it and restart unity, this engine is a joke
Unity is built on mono (opensource implementation of .net), so it can load dlls
Let me delete the library dir, maybe unity did the unity thing and corrupted itself
nop
yo why does Math.Round(); not work?
doesn't work in what way?
well it doesnt round up the number
and you probably wanna be using Mathf not Math when working with uniy
interesting
but what difference does it make
well would you mind giving us an example?
like what the input and output is
well its still a long decimal number
floating point precision probs