#💻┃code-beginner
1 messages · Page 215 of 1
yea int
for the float form, it will (though very unlikely)
that's good to know
As it says in the docs, no.
thanks
you can always check the docs for this kind of thing
woohoo it works
that is actually so cool
custom gravity
this opens up a whole bunch of doors
thank you praetor and others
is there anything wrong here?
yes, your IDE is not configured
that's the main problem
Get it configured
!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
• Other/None
I can tell because despite the obvious errors in your code, there is no error underlined/highlighted.
It does?
It does what?
I've been trying to firgure something like that out for a will, I thought it had to do with extentions in vs code
follow the instructions linked, it will sort you out.
really helpfull thx
Do I have to restart unity for it to work?
https://unity.huh.how/ide-configuration/visual-studio-code this might be helpful
thx
Has anyone used boat attack to get assets? Any tips on how to get it to download?
Looks like the instructions for downloading the project are here:
https://github.com/Unity-Technologies/BoatAttack?tab=readme-ov-file#getting-the-project
thats what im trying to do, but I am unfamiliar with how the GIT works
( you do need git and git lfs installed, as noted)
is joyStick.gameObject.SetActive(true); the best way to enable and disable my joystick?
wdym by "best" way? That will certainly deactivate the GameObject your Joystick component is attached to.
it's unclear what type joyStick is though
because im using a floating joystick and i make it disappear and reappear, i am able to see it. but i dont want to be able to view it untill im using it
does that make sense?
sure it makes sense but I still don't know what you mean by "best way"
that will deactivate the object
like i want a way to deactivate it and then reactivate it without seeing it
becuase i can still see it from where i last used it
is there a way to do that?
what's wrong with what you have?
its works. i feel like it would probably look better without it in the way.
So if it works what's the issue?
i want it to be invisible when i reactivate it so it is still usable.
sorry if my explanation is not very good
Do you understand the difference between a GameObject and the components on the object?
components is the things inside the gameobject i think like the scripts.
anyway if you want the joystick to be invisble wouldn't you just remove or disable whatever the visible components are on it?
E.g. the Image component or SpriteRenderer or whatever it's made of
ill try that
I honestly still don't understand your question
There's no context here. You say "When I reactivate it", but what does that mean? What's the context in which you're deactivating it?
Is it supposed to be visible at some point and invisible at other points? And still functional during some of the time that it's not visible? Confusing.
the code i showed above activates or deactivates the joystick. i want it to be always invisible but usable in some points of the game and unusable.
but when i activate it, i can see it, wich is what i dont want
that makes more sense?
if you always want it invisible you should remove whatever components render it
or set their alpha to 0
that's a completely separate thing from activating/deactivating it
I don't even know which script you're talking about
I already made my recommendation here
are you talking about the code that i showed above?
which component
you're speaking in such abstract terms. You are aware I can't see your project right?
I don't know anything about your joystick
ill just try to see if i can fix it on my own. if that doesnt work, ill try doing what you said before.
I have those both downloaded, i just dont see it as an option when I make a new project
you don't see what as an option? Who said anything about making a new project?
BoatAttack is an existing project
it wouldn't be a new project you are creating
why do you want me to do that.
I don't want you to do anything. You are the one that said you wanted it to be invisible.
could you help me what this means?
Not until you share some details about this "joystick" of yours
what it's made of
how it's rendered
etc.
presumably there's either an Image component or SpriteRenderer
Basically, alpha in a Color is just how much visible is a Ui element
i get it now. that could work
Anyway you don’t want to have an Ui element always invisible and active in the scene
Its bad on performance (IF NOT WRONG)
I mean everything affects performance but you need what you need
i want it to be invisible until it is used. which is how a floating joystick works by default. but i dont want it to be usable in the menu so i disabled it.
and then enabled it
when u play
Is it not generally bad to keep active something due to the fact that, you need to render it anyway? Invisible or not?
what's the cost of rendering this thing?
is it going to bring the game to its knees?
There's no need to be concerned here
Idk, just saying. You probably know much better than me
everything is a tradeoff.
It's not worth spending a lot of effort to shave 1 nanosecond of performance out.
K, thanks for the explanation
hmm I think what i am failing at is getting it to a local file, any tips?
getting what to a local file?
Did you follow the instructions to clone the repo?
My tip is to follow the instructions. That will put the project on your computer.
Then you can open it.
Also disabling/enabling objects on canvas can be much costlier, because it will update everything on the canvas.
Really?
Just hiding from view is more performant
i have the CL working, and the files show up in my account on github, just not sure how to get them local (the boat attack)
WDYM by CL?
and what do you mean they show up on your account on GitHub?
There's no reason they should "show up on your account"
all you' need to do is clone the repository to your local computer
you can do that by following the instructions I linked above
could I just send you screenshots of what ive done to try and see where im going wrong
Yes you should be showing what you tried and asking clarifying questions
using singletons, throwing a null reference exception when its called, causes?
Same as any null reference exception - you tried to dereference a null reference. I.e. you didn't assign whatever field you're trying to access
first step is identifying which field is null
Its saying no when i call the method inside the singleton
Be specific
then your singleton reference is null
i.e. your instance field or whatever
If I use Mathf.CeilToInt(Mathf.Log(value,2)));
Will there be any scenarios where floating point error occurs, and sends wrong value (off by one)?
Like, if I send value 4 , and some day eventually it sends me 3 instead of 2?
It's not a random cosmic occurrence.
it is perfectly deterministic
Oh that's great to know 
Idk why I always thought floating point errors are kind of random and everytime it will be slightly different
you need to enter the full url
gh repo clone https://github.com/PATH-TO/REPOSITORY
tbh I really don't recommend the github cli though
just use the basic git cli
git clone <url>
to get the url:
look
gh repo clone {the link}
you are all incredibly patient and I appreciate you
man fuck the github cli
just use the git cli or any git GUI
btw it's also possible that Access Denied is coming from it trying to write files inside your Users/Brandon folder. What happens if you just run touch test?
why are you running git lfs migrate?
you should merely be cloning a repository
!code
📃 Large Code Blocks
Use links to services like:
https://gdl.space/, https://paste.ofcode.org/, https://hatebin.com/, https://paste.myst.rs/, https://hastebin.com/
📃 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.
Can someone help me debug my code
Depends, what problem are you having?
but I’m trying to get the boat attack program downloaded and am really struggling, if anyone could do a messenger call or something to help me figure it out I will gladly pay you
download as zip
im making a pokemon game
for my coursework
during the battle
the player is movin in the back
and its causin errors
fix the errors
neither do we as we have not seen either the code nor the errors
Do you know how to read an error?
``c
private bool IsWalkable(Vector3 targetPos)
{
if (Physics2D.OverlapCircle(targetPos, 0.2f, GameLayers.i.StuffLayer | GameLayers.i.InteractableLayer) != null)
{
return false;
}
return true;
}
and that is?
First of all, you should ask yourself why does the player even move during battle
Movement should be locked, do so when starting a battle
or have a separate battle scene whatsoever, but you'd still have to lock your player during the battle animation start (that is, if you have any)
@quartz mural you are not going to get any help if you don't answer questions
is there a way to pause an animation and reverse it from the moment it is paused during an execution?
Try googling stuff
There are tons of already answered questions online
And as you can guess, setting the animator speed to a negative value will play it in reverse
Alright thank you!
is there any good tutorial for huds on 3d unity?
or its the same as in 2d model unity
like with the canvas and so
Heyah, I edit avatars for VRChat, and when VRChat switched over to using 2022 unity version, I noticed that whenever I switch playable layers, or use presets, or even switch animation settings, there is a window that pops up and stays for 2 or more minutes which says things about the unity core finishing executing. It's very stressful because I cannot find anything online about it other than people saying they have the problem but not knowing how to fix it. The only thing I found was clearing the shader cache might fix it, but that only sped up a little bit. Is there a solution to fix this issue?
This isn't a code issue, so shouldn't have been sent here. And it just sounds like one of the progress bars that pops up while Untiy is doing something.. nothing there sounds like a problem
This is not a Unity problem, the core scripts running is caused by non unity code being processed so I would suggest you contact the VRChat SDK publishers and complain to them
Hello, apologies for my newbie question. Most tutorial suggest to use NavMesh+InputAction+Raycast to move a GameObject onClick of mouse in a 3d game. Is that the case ? Or should I look deeper into Physics documentation ? I do not have a use case for NavMesh except the movement on click of mouse.
Lookup a tutorial and try it out
I tried NavMesh. Its working well, except seems like an overkill. I was using Physics to move on press of Key. I wished to know if NavMesh is the better way to do it, or should I read more Physics
Thank you for the information! I will try to message VRChat help now that I know it's nothing to do with Unity itself. ♥
Why isn't this working? I'm trying to access a variable from another script on the same object
Oh and thanks as well Carwash, I am new to the discord, I wasn't sure where to post it, next time I will attempt to look harder for the correct channel.
How can I code in a simple Wait(float seconds) function?
because that is very far from C# syntax
I tried something like this:
public static class Static
{
public static IEnumerator Wait(float time)
{
yield return new WaitForSeconds(time);
}
}
But all that does it make the editor and game freeze
depends what type of movement you want. Something like NavMesh is only needed if you want to do path finding, if you just want to move in a straight line, then path finding isn't required
Either Unity coroutines, invoke or a self implemented timer.
You need to place your code in the coroutine.
this code does only one thing
yield return a waitforsecond object
Thanks. I wish only straight line movement. And handle few collisions only. I will check Physics more. Thank you.
I'm confused. How can I access a script on the same gameObject?
lots of tutorials on that , google -> unity how to reference other objects
the getcomponent bit is correct the left hand side of the statement is not
I know that I can access an object parent using transform.parent.gameObject., but how could I acess the parent of the parent of a gameobject?
another transform.parent at the end ?
oh, I see
hey its my day 1 of unity
good luck
i was going through a tutorial of unity on youtube
a simple one
flappy bird
but the code isnt working
needed help
please type in full sentences
may I suggest you first read #📖┃code-of-conduct
When you're following a tutorial, if there's works and yours doesn't.. you did something wrong/ missed something, re-watch the tutorial
How to post !code
📃 Large Code Blocks
Use links to services like:
https://gdl.space/, https://paste.ofcode.org/, https://hatebin.com/, https://paste.myst.rs/, https://hastebin.com/
📃 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.
spelling mistake in your very first line, these things are important
Got this line of code here that checks if the parents parent of the object collided with has a script called EnemyFollow and if the bool is true, which it should be. The parents parent of this object is the enemy's body, which has the EnemyFollow script on it. But whenever one of the enemies hit me, I get an NRE. Not sure why. Can anyone help?#
Don't do all that .parent stuff, use GetComponentInParent<T>()
Hmmm, it seems like adding " == true "" has fixed it, I think?
honestly you can debug those on your own by just breaking down the lines and asserting or debug.logging when one of those things is null
you'll learn more and we are just guessing
in general, you can get anything done if yuo just break it down to its smallest piece. debug.log what you are asking about, and put stuff into the inspector
one of the most powerful things about unity is how good of a visual debugger it is
No, that is never needed and doesn't change anything
if(myBool) is the same as if(myBool == true)
Is it possible for me to use the "collision" in my "OnTriggerEnter2D" in my method below?
Hey I'm sorry for the individual messages earlier
I'm new to unity and was trying out a tutorial in youtube but while running the game, the game is sensing input from the keyboard like how it is in the code
This is the code
yes, you can use it, that's why it's passed into the function
i think they are asking about their method, which they can use that object in if they pass it as a parameter
right...
I can use it in the OnTriggerEnter2D, but can I use it in the PunchEnemyKickBack()?
Yeah, I think so?
you can if you pass it along
it's just a component of an object
and yes you need to pass it in. look up variable scope...
So what's the question?
Is there anything wrong with the code which is causing the keyboard input to not be taken
Maybe try placing a debug log inside the update function
If you get spam in the console window of unity, the function is being called.
Next you would try placing it in the if-statement
Does anyone have a yt channel which teaches unity and focuses on teaching unity instead of doing a project
There's Unity !Learn (most of their videos can also be found on YouTube)
:teacher: Unity Learn ↗
Over 750 hours of free live and on-demand learning content for all levels of experience!
It's completely free either way
where can i ask UI questions
What kind of ui questions?
When in doubt, you can try in #💻┃unity-talk but this would be the beginner coding channel.
what the difference between text and textmesh? i try to drag to a button and it isnt the same type. Where can i find the normal text?
Maybe you should stick with tmpro, it's better.
Alr ty
I'm currently in a situation where I have one prefab in my assets that acts as an in-world item, this has a script that holds the scriptableObject that item relates to. I wanted to have it so that inserting a string will then perform the right tasks to create the correct in world object, which sounds like the factory pattern would fit. I've been trying to follow Unity's factory design pattern overview video, although I am still trying to wrap my head around how it works.
In this situation then, I want it so that there's a text box on screen, and you type in a string. Pressing a button should then run the factory for that item, giving the prefab the correct item type. How then can I make it so that it chooses the right factory based on a string without it being a mess?
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
https://docs.unity3d.com/Packages/com.unity.textmeshpro@1.1/api/TMPro.TMP_Text.html
The above would be the base class. You can explicitly refer to the tmpro or tmprougui if you want as well.
It looks like you cloned something in the scene
(Clone) is appended to gameobject name when it's created via instantiation
Gameobject name does not affect any components like text, so I assume you are setting the text to the gameobject's name
I believe I have completely butchered this factory pattern, my word. Are there any decent sites that cover these patterns so I can understand them better? My way works for what I want it to do, but it doesn't seem like it follows the pattern properly
Hi 
Currently experiencing the strangest thing, I feel like i'm just missing something. Both the strings are exactly the same but it just skips over the rest of the if statement. cs inputString = textInput.text; Debug.Log(inputString); foreach (var item in itemDatabase.Items) { if (item.itemName == inputString) { materialFactory.SpawnMaterialPrefab(item); Debug.Log("Spawned " + item.name); break; } }
Check this #💻┃code-beginner message
Maybe its a similiar issue
Oh i see. What do they mean by the input field of it? I just get it through .text
tmp input field
It adds an invisible character to the .text
that's what I'm using
well that seems to be working now :)
what a strange issue
no matter
Seems kinda annoying, yeah.
Ah the joys of messy code
i need help I have all the Transicions set to Condition _example but it only plays one am i doing it wrong?
sorry cludnt find it 😄 thx
Hi,
I want to make a Light Flickering effect, and put morse code as flickering.
Whats the best way to do that? Coroutine?
im new to unity and coding is there anything that can help me get more info about the code ?
I find ChatGTP is really helpfull, just paste small or large bits of code in and ask it to explain it to you, say you are a beginner so it knows what level you are at.
please don't recommend AI. especially for beginners
there's no way to verify the answers it gives
I've been coding in Unity for 15 years or so, and before that C++, C, Assembler. So I definitely have some experience in programming.
But I still go to ChatGTP almost daily, for things like regex, it just completes it for me almost instantly
Oh don't worry, its really good nowadays, it makes hardly any mistakes at all, and knows loads about Unity.
the difference is you have the experience to verify the answers yourself
they don't
Yes, but doesn't thaat apply also to stack overflow, or random git projects, or googling. Or, the Unity documentaiton also 🙂
if you really want to compare answers given by a community that is open for discussion, hence can be verified vs generated answers from a language model, then i don't wish to continue this any further. we'll agree to disagree
there's the Unity documentation. there's also Unity Learn which is unity's official tutorials
!learn
:teacher: Unity Learn ↗
Over 750 hours of free live and on-demand learning content for all levels of experience!
Look like you have two suggestions here then rocksys 🙂
in that case, qualify your 'use AI' answers with ''I know what I am doing, this may not apply to you as you said you are a beginner'
i would create an array of times for the morse code, then loop and run a timer for each time. when that time experies, flick the light on/off, and move to the next timer . . .
I'm only giving recomendations though, as to what I would do I'm not saying its the only way, in fact reading back what I oriiginally said it is plain I'm giving an opinion because I started with "I find ChatGTP is really usefull...."
Its clear it isn't for everyone, but I'd be being disingenuous if I was to pretend it isn't useful to me every day.
As an example of how it works >for me< , is I have a Junior Unity developer here in the office with me now. And when giving him tasks, I will now write for him a specification for him to ask ChatGTP about. It is working really well so far.
lmao that sound's like a terrible learning path for your Junior
absolutely, if a junior of mine was caught using AI he would be looking for a new job
same
well, depends on what
if for some data comparision for exmaple, then sure
but for coding? cya
You are welcome to hold that opinion. I'm delighted with the results so far.
Look, Itotally understand a lot of people have negative opinions about AI, for lots of reasons, it can be challenging in many ways. I've not got any more to say other than those examples of where it is working for me.
But I'm really not trying to convince anyone, just that I'd be dishonest iif I was hiding this information away and pretending it wasn't useful right?
I hope you can take my words at face value, and not think I'm threatening you or your habitual way of doing things.
sure
you are delighted in how you are training your juniors to be competent programmers?
im just feeling sorry for that juniors thinking they are learning the proper way
that's all
Yes, I can give you examples of the tools and systems he has created in the last couple of weeks, and even show you the GTP generated source code. But msg me privately, lets not fill up this chat with AI debate.
imagine having Senior above you, and he's ordering you to learn from chat gpt
absolutely ridicilous
Well that's how it is here. I'm not sure if I should argue if it is ridiculous or not. Its just working well like that. Take from it what you will.
Sure just expressed my opinion
if chat gpt code is good for you
then alright i wont argue
That's great, I wasn't looking for an argument. Just trying to help a beginner with some advice on what is working here for me.
back to my point, don't do that, what works for an experienced programmer will definitely not work for a beginner
my issue with recommending ChatGPT is that they are a beginner. a lot of code generated from AI is incorrect; they are new and just learning, they can not know and will expect what they receive to work. this will greatly hinder them, making it harder to learn the language
since you have prior experience, you can comprehend the incorrect information ChatGPT gives and know what to ask it. that is a big difference for a newcomer . . .
Msg me privately, and I'll show you some examples of ChatGTP 4 answering unity questions and generating code. I am assuming from your chat so far that you are going to be a bit blown away by the current state of play.
I got disappointed when i asked the formula for exponents that can allow for imaginary or negative fractional powers.
he forgot the unity part
Ok, I feel like I've over spammed this very nice channel already. So anyone that would like to chat privately, and I can show more of how ChatGTP handles Unity questions.
i would like to chat privately, just because im bored af
Anyone know how can I send heart rate data to Unity with polar chest strap?
can the data be accessed via the web?
Idk, i'm ok with any method
you need to know
its a bluetooth device, theres a github repo for getting inputs in unity for the H7
I asked gemini and it told me to use Excite-O-Meter plugin
Figuring out a way to get that information to a PC would be a good start. From there you can work backwards.
there's even github link to the code, i'll read it
do you have any link to the document or something? i'm really new to these kinds of thing
its the first result in google
has a link to the github
Hello, I don't know where to ask for help so I ask it here. anyone knows why I always get this error message when I try to export an animation ?...
This isn't a unity class
I am, in fact, blown away. By how it just straight up does not understand what it is pasting back at you. It just puzzle pieces together bits of code it scraped from stack overflow
In this case though, isn't it just that there is no special Unity stuff to use. I mean, Unity doesn't supply its own Complex number class does it? Maybe it does, I'm not sure in this case.
Good luck running that main method buddy.
oh right, i see what you mean now 🙂
The fact that you don't even see how it won't work shows that you don't know enough code to be able to utilize ai
the problem here is a beginner would not know how to run or use this code at all, confusing them further . . .
I added Unity Engine instead of Unity to the question..
But yeh, this is perhaps best demonstration of how to use ChatGTP.
It can be almost perfect, but stil useless sometimes without human input.
And again it fails. Using doubles, using C# Math instead of unity Mathf
I love how it it mentioned the link to stackoverflow though
i mean... there's no reason a "complex" or "exponentiation" class needs to derive from monobehaviour to be fair
also not sure why you'd give the exponentiatoin function an entire class itself...
Funny enough though, my originaly suggestion wasn't to use ChatGTP for code generation ( although I do do that on a daily basis ) but for pasting code and asking it to explain it to you.
Again, if anyone wants to chat privateley I'll be happy to show examples. Its something I find really mindblowing
Its just an example from earlier, someone else mentioned this algorith, so I typed it into ChatGTP as an example
true, but how would a beginner understand this or implement it? someone already knowledgeable could break this down and rebuild it for unity, but they'll (beginner) just copy/paste and expect it to work. that's the real issue at hand . . .
right...
i think the best we could say is that chatgpt gives plausible results if you know enough to figure out the mistakes but if you have no clue, it's not necessarily going to be helpful
because a beginner in the chat was asking for learning material and where to get started . . .
The problem with using ChatGPT as a tool is that by the time you're a good enough programmer to sort the bullshit from the useful information, you're a good enough programmer to no longer need it
I can say, with total honsety, that it is working really well on a day to day basis here. In fact, literally 5 minutes ago I was at the desk with the Junior programmer who is currently using ChatGTP to make a 'mouse over' tool tip object.
I'm amazed at how fast and smoothly it is going for him. It isn't without problems, but my input into this has been very small. And he is learning a lot about the code and unity in general as he buildsit.
i think the best you could say about it is it's a good natural language search engine
id feel shafted as a jr being told to use chatgpt.. imho
I think what we can say about it is less interesting than what it can be used for.
That's why I just keep coming back to the fact that I'm using it every day, for stuff I could do but I want to save time. Like creating a semi complex regex capture for me.
I'm also using it with the Junior developer here, and it has been very useful. Is working really well.
I also use it when I'm programming in a language I don't have experience in, such as Python. This works well because I can still sanity check the code it produces , and ask it quetrions about the Python syntax I don't understand.
I also used it succesfullly to make an iOS app ( using Swift/XCode ) and even had it instruting me on what to layout in the interface builder, and how to connect the widgets to my code. This was a complicated app using the camera, openCV and some bayseian inference algorithms.
He says he enjoys it. Maybe he enjoys being shafted, I won't be clarifying that part with him.
Can ya'll please help me understand this error message? I'm trying to pass the "collision" from the OnTriggerEnter2D into the PunchEnemyKickBack() Method
you've left the param to send blank
Collider2D is not Collision
i dont see a problem for a junior to use chatGPT, as long as he knows how program already
I'm not sure if you've seen the latest AI Video Sora from a few days ago. The difference in the quality today compared to Will Smith eating Spaghetti a year ago is mindblowing.
A similar improvement has been happening in LLM like ChatGTP. So I think a lot of opinions on ChatGTP code generation and understanding are easilly updated just by going to https://chat.openai.com and getting it to write you some code.
did you get that from moist critikal
yeah, saw it, its awsome
If they know how to program, they likely don't need it
What is moist critikal?
yikes
And I think you have a very poor understanding of how LLM's actually work
i will have to dissagree, me for example, i have almost 4 years of unity experience and 5 in general programming, but i work as a junior in unreal which i am still learning how to use, and since unreal documentation is practically non existent i use chatGPT to explain unreal's API's and also do math for me cuz i suck at math
I'm with v0lt on this one 100%.
Withough wanting to embareses anyone, I think this conversation is one sided, because the two people using ChatGTP daily, are both singing its praises.
And the people who used it in some previous version months ago have written it off.
Just go there and test it again, you will be pleasently surprised I promise 🙂
firstly, you sound like a nun and secondly where do i ask questions for basic and common knowledge
You are right, the advancements in AI even in the last 2 years has left me really unable to comprehend the finer details.
ANd i studied Artificial Inteligence at University College London, so you'd think I'd have a better grasp of it right?
im not debating AI, AI is a great tool, and has advanced ten-fold.. but in terms of a Jr dev being told to learn with ChatGPT.. just seems to me the same vibe as going out and getting guitar lessons and the instructor sending you to youtube
Even if someone sounds like a nun, so what? That doesn't make what they are saying incorrect, or correct, so why even bring it up>
i never said you were wrong? i just pointed out you sound like a nun
my mom went to a catholic school
where do i ask questions about unity's mesh filter thingy
if its code related here..
in the channel appropriate for it, this is a code channel. Use id:browse to find one
if u just have general questions about the mesh filter component use #💻┃unity-talk
I actually learn more from two 10 minutes videos from a random guy on YouTube than in 1 year of class with a certified tutor
shitty tutors then 😄
i feel like there is a bit more nuance then just learn with chatGPT, i pretty much tought unreal myself with chatGPT, tinkering and googling stuff, but prior knowledge also helped a lot, my senior only helps when when i hit a roadblock
being self taught solo dev is alot different then working under a Sr
i am self tought with unity, but i only use unreal at my job during work time
cool, keep it up 👍 knowing both engines is good stuff
eh, i dont rly like unreal, i only use it cuz its my job, unity will always be the one i want to master
if unreal had as much resources as unity, i'd probably be using both by now..
only time i fiddle with Unreal is for artistic stuff
getting waaay off topic now
If you subscribe to a function inside an object that gets destroyed then you must add OnDestroy code to unsubscribe the functions?
OnDisable also runs on destruction?
Also how to detect if a gameobject from the list is destroyed?
Trying to get a component out of it and see if it fails?
just check if it is null
google?
or test yourself
in 1minute
Im kinda not at pc atm. Im just gonna leave it on destroy
Im doing this as of now, debugger has issues with use of lambda expression to clean a list of objects. So I thought I messed up.
dont use anonymous functions then
_initializedObjects.RemoveAll(obj => obj.gameObject == null);
will this clean null objects

Hi. Quick question, why is it that I cannot drag and drop the "GSA_scriptableObject" assets into the following variable in the inspector please?
public GSA_scriptableObject[] GraphicPresetsArray;
The code for the GSA_scriptableObject is the following:
[CreateAssetMenu(fileName = "GSA_scriptableObject", menuName = "ScriptableObjects/GSA_scriptableObject")]
public class GSA_scriptableObject : ScriptableObject
{
public GraphicSettingsAsset settingsAsset;
}
huh
Check the error message and make sure it is true . . .
Is the file name the same as the class name?
oh so I can't change the name of the scriptable object asset? Because that is what seems to be breaking it
that is not what the error is saying
well but not changing the name seems to fix it lol
the name of the asset bears no relationship to the type of the asset
I do get this error tho, but I can just remove it and continue
what is the whole stacktrace?
your code or unity?
how to check for a collision with a specific tag in OnCollision Enter()

check the tag
yeah how
what do i even google
Sure, what have you tried or searched? There are tons of examples online . . .
no idea, but for now it works, so I'll just not touch it again haha. Thanks for the help everyone 😄
what has a tag?
The same question you asked us . . .
"how to check for a collision with a specific tag in OnCollision Enter()"
lol
ok
hey it works
nice
i found it in a unity discussion
it's easy to work out for yourself
What has a tag? a game object
What has a gameObject property? a component
What components does a collision have? a collider
so the answer is ...
collision.collider.gameObject.tag
Always search your questions on Google or YouTube first. 90% of the time, there's an answer with code, a video, or a tutorial . . .
for (var i = 0; i < _initializedObjects.Count; i++)
{
if (_initializedObjects[i] != null) continue;
_initializedObjects.RemoveAt(i);
}```
This aint finding null objects...
Im pretty sure someone told me that GameObject do not become null when destroyed
wait it worked
this code is busted
Some serialization issues I guess
you would have to do a reverse iteration to reliably remove things this way
likewise you could also do:
_inializedObjects.RemoveAll(o => o == null);```
only one object at a time gets destroyed
I had this before and it didnt work and debugger couldnt show me steps on lambda
there's no reason a debugger wouldn't be able to step on the lambda
It tells me its outside the environment
what tells you that
the visual studio points of intrupt
if you want to really make it debuggable do this:
bool Remover(UnityEngine.Object o) {
return o == null;
}
_inializedObjects.RemoveAll(Remover);```
Im not sure what happend but I cant turn my Scene perspective?
What's stopping you?
Are you in 2D mode?
The 2D button will be highlighted
is there a difference between returning true and false or null in a coroutine?
hey guys, im currently working on implementing a tutorial or level progression system in Unity, and i just wanna know the most effective approach. im trying to establish progression conditions such as requiring the player to defeat an enemy to open a door, and then setting the next progression condition once the door is open
would using a finite state machine approach be best or are there any other reccomendations before i comit to a FSM
true it was
Those will all be treated as "yield for one frame"
The only special things Unity is looking for from a coroutine are YieldInstructions and CustomYieldInstructions
the player should have some monoscript that listens to events that can generate exp, does relevant level logic, and then invokes events when its status changes.
This is... a bit off-topic here.
Post to the wrong server by accident?
yes
lol
lmao
good game tho
it is
i'd probably do something like have a tutorial manager that orchestrates the whole thing, including listening for appropriate events and setting the scene variables as needed. the manager would have a list of tasks that each defines what needs to be done, what to change, etc... and you'd progress through them as you finish... not sure if that's the best approach but that's what i'd do...
private void CleanDestroyedEnemies()
{
for (var i = 0; i < _initializedObjects.Count; i++)
{
if (_initializedObjects[i] != null) continue;
_initializedObjects.RemoveAt(i);
}
}```
I noticed that for some reason first kill always gets kinda skipped? It feels like OnDestroy runs slower then this check and cause of that that enemy gets skipped
that wont work
think about it
you are modiyfing the collection
when iterating over it
reverse the for loop
OnDestroy takes a whole frame to process yes
it doesnt actually destroy the thing until the end of the frame
is there a reason you're doing this instead of just _initializedObjects.Remove(theDestroyedObject); when it is destroyed?
because destroyed object has no reference to the objective and objective has them objects serialized
have it fire an event
have an event listener remove it
I have a bit different even that looks at the score and it fires the check
Im gonna add other event then I guess
Where should I fire this event even?
inside OnDestroy?
in the code that destroys the enemy or whatever it is that's being destroyed
you should remove it from the list aswell, not only Destory() the object
To delete it from the list I somehow need to detect who makes the call and differentiate the objects
as of now I think it will be easier to just delay the check with corutine delayer
that doesnt sound good
the event can do that
pass the game object instance with event and just delete the object like that?
Why are different objects calling delete on it?
public delegate void EnemyDiedHandler(Enemy source);
public static event EnemyDiedHandler OnEnemyDied;
public void Die() {
OnEnemyDied?.Invoke(this);
Destroy(gameObject);
}```
isn't Action<Enemy> OnEnemyDied just simplier?
Not sure why delegate here?
I always prefer custom delegate types for clarity, but it's a personal preference
events need delegates
I did not use delegate for events?
events are delegates?
impossible because events ARE delegates
private Action<float> _function;
the only thing I did you might not be used to here is define a custom delegate type
Action<float> is a delegate
Action<float> is a built in delegate
Ah
so you did indeed use delegates
I ment delegate name
right as I said, it's just a preference. It's not that important to the point of this
which is to use events
what if I want to add some functions to unique enemies? then it cannot be static right?
if you want each one to have its own set of callbacks, it can't be static
Not sure I understand what you mean. The event can be static, that's not related to any other thing about the enemy
i meant what @low path said
sure
Should I pass enemy or gameObject?
but I don't see that as a requirement in general
I think it's always better to passs Enemy because you can just do .gameObject on it to get the GameObject
how would I handle the references then? static event is super easy and accessible everywhere
let's say I have ScoreManager (singleton) and want to increase the score each time an enemy dies
this is like the perpetual discussion re the "simplicity" of globals
Will this do?
whenever spawning enemy i should add AddScore() from ScoreManager to OnDie event?
yeah, then your score manager needs to listen to an enemy manager which fires off an onenemycreate(enemy) event. then you hook up the score manager to that specific enemy... or your manager can directly fire off the event...
oh that way
it's more work to plumb all the stuff like that
Are events better then checking on fixedupdate?
the reason you use events is to decouple stuff
yes
or really to reverse the flow of dependencies
because you have a hierarchy of central to peripheral things
you don't want your central components to be dependent on peripheral components
so i should have ScoreManager that has a reference to EnemiesManager
because then every time you make a new type of peripheral thing you have to change all your main stuff
that's what i would do
yes that's what i would do
to me that is the cleanest way
you shold follow single-responsibility rule
instead of making one big GameManager
for everything
it's not big now
And most of it are storage
I know i did that
single-responsibility
Where I needed
i mean.. it's fine to have a 136 line class like that
but i think at some point if it gets significantly bigger, you will probably want to refactor...
yeah its just too small to make 4 different classes
that's a bad assumption
oh but you do have four different classes
because those scripts have quite different roles and are more complex then data storage
It got its name as inheritance from my previus project from where I yoinked it
its like generation 3
Can someone help me investigate why my models do ballerinas moves or fly away when they die, it should be ragdoll? I set them up properly. I use animation on them, when they die i disable the animator first then the agent, then enable the ragdoll so they just should fall right? I also checked every rigidbody velocity when enabling ragdoll and it's 0,0,0 so there is no force applied or stored to them in any way (shooting them with raycast btw). So i dont understand why its happening. colliders don't touch each other either.
maybe share the death script?
the important part of death script:
` anim.enabled = false;
agent.enabled = false;
if (!isRagdollActivated)
{
isRagdollActivated = true;
rd.EnableRagdoll();
}
this.enabled = false;Ragdoll's script enableragdoll method:
foreach (var rigidbody in _ragdollRigidbodies)
{
rigidbody.isKinematic = false;
rigidbody.useGravity = true;
}
`
private void OnKillsBasedLogic([CanBeNull] EnemyController enemy)```
Why ? becomes can be null?
...what
Can you rephrase that question
I tried placing EnemyController? but it automatically becomes CanBeNull
yes
Well i want it there
then leave it
Hey guys !
I m new Game developer , I m really noob at this
I hope from the pro guys to give me the best way to start and learn faster
Hello guys, i have a question about making my build system. I have a 2d game where you can build your own spaceship, you can place rockets/stabilizers/booster etc. What's the best way of implementing them? Should i create a different script for each rocket or connect them to a base script. Also whats the best way to make a booster increase all of the rockets speeds in the ship?
!learn
:teacher: Unity Learn ↗
Over 750 hours of free live and on-demand learning content for all levels of experience!
Hey, guys! I got an error on my console in Unity Editor but the error is only seen at the top right of the console with no message at all. Do you know why this is happening? Also, It's happening when my player enters the trigger of the other game object.
wdym "top right of the console"?
Could u share a screenshot?
Of course!
Give me a minute
Also to note I am making a flappy bird game were I am using Object Pooling method to instantiate my game objects so thats actually happening whenever my player reaches the other instances of the game object and not the original one.
You have the errors hidden (see how the background is different than the other two)
Click the red icon to show them
You can hide logs, warnings, and errors by clicking those, which can be helpful if you are flooded with one of those and want to view a different one
I feel like it should be more obvious in the Editor UI lmao thats so ez to miss lmao
I dont see it on my console btw
Click on the Red Icon
In the Console
Then it was just above where you were. You have a LOT of logs
I mean I have to disable the messages first
Share a new Screenshot so we can confirm
Then you missed it. It was there if errors were not hidden
You have a LOT of logs
They can be hidden?
That's what you did in the first place...
#💻┃code-beginner message
I have prefabs
What.....?
I have them as prefabs
Have WHAT as prefabs?
Logs and other game objects I want to instantiate
Logs aren't prefabs....
Oh u mean u print something in the console when u spawn something?
That makes no sense
I have my logs as prefabs
do you mean logs as in like from a tree

You will need:
- A data structure to hold information about a ship, which can validate to make sure valid input is added. This data structure must be serializable to save.
- Interface or abstract base class for a part that can be added to the ship. Ship data structure holds objects of this type. Requires serializable interface plugin for interface.
- A Build System monobehaviour that interfaces with the ship’s data structure, to mange using input to put things into the ship. This should use methods in the ship data structure to validate edits to the ship.
- A save manager monobehaviour to handle saving and loading the ship to/from a file. This should (again) validate to make sure the file contents are valid on load/save.
Then you can make classes for specific parts that use the interface above, for actual gameplay elements.
Eithr way....
Oh, why are you bringing them up then?
You mean like models of wooden logs? That was super confusing when we were talking about console logs
Ur warnings were turned off
Just turn them back on and maybe stop putting so much into ur console
Yeah... but it was in the middle of a conversation about why you couldn't see an error in your console. Are you trolling?
Do you really think I am trolling?
Yes
I am a serious guy and try to make something
I am here to get help
I dont want to waste my time
I already have a build manager that handles the build system of the ship, i just want to add the functionalities. Should i use abstract classes
by trolling
i would use an interface, and download a plugin for serializable interfaces
bro just click everything except the red icon to only show errors
what is a serilazable interface
do you know what an interface is
So I have to disable messages and warning and then I will see the errors?
Thats what I did
No. You just have to NOT disable errors
You have to enable them
I disable messages but not warnings and only leave error enabled and it worked
If errors are not disabled, then they will be there
Just turn them all on
I mean
yes
and you know what it means for a class to be serializable
I am not disabling errors but when I scroll up and down I dont see the error its like it doesn't exist
I have everything enable
i only use it to make it show up on the inspector
To be fair, he had way too many logs going for some reason. So he missed the error before
Can u see the error?
Maybe I miss something because there are 999 messagves
Remove some of the useless debug.logs in your code
serializable means you can save the variable to a file (through normal means)
If ur logging to ur console every frame ur not going to see 1 error message out of 1000 messages
I have to clean up my code a little bit yeah
Turn off the constant logging
Thats what I am going to do
unity inspector just tries to show entries in inspector view for things that are serializable, if it can
You can also collapse the console messages
You don't want to always do that though
so whats the reason to add it to all components of the ship? couldnt i just add it to the parent object
classes/structs/etc that are not serializable cannot be saved in a simple way
No problem! Here's the translation in English:
Hello everyone, I'm facing an issue in my Unity project and could use some assistance. Here is a description of my player script:
public class PlayerAction : MonoBehaviour
{
public float MovementSpeed = 5;
public float Speed = 5;
private Rigidbody2D rb;
public GameObject kamera;
// Mobile Steuerung
// public FixedJoystick joyStick;
private void Start()
{
rb = GetComponent<Rigidbody2D>();
}
void Update()
{
CircleMovement();
}
void CircleMovement()
{
float vertical = Input.GetAxis("Vertical");
transform.Translate(Vector2.up * MovementSpeed * vertical * Time.deltaTime);
transform.Translate(Vector2.right * Speed * Time.deltaTime);
kamera.transform.position = new Vector3(transform.position.x, 0, -10);
}
private void OnCollisionEnter2D(Collision2D collision)
{
if (collision.gameObject.tag == "Enemy")
{
Debug.Log("Player collided with Enemy");
Die();
}
}
void Die()
{
Destroy(gameObject);
}
}
The player is tagged as "Player" and has the default layer. It has a circular shape, represented by a Circle Collider 2D. The enemy is tagged as "Enemy," on the default layer, and has a rectangular shape, with a Box Collider 2D.
Despite the logic specified in the script, the player does not get destroyed when it collides with the enemy.
one object can only actually be serializable if everything it contains is also serializable
📃 Large Code Blocks
Use links to services like:
https://gdl.space/, https://paste.ofcode.org/, https://hatebin.com/, https://paste.myst.rs/, https://hastebin.com/
📃 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.
Better use a link for that
if you say your ship is serializable, and it contains an IShipPart field, but you have no way to serialize interfaces, then you can’t actually serialize the ship to save it to a file easily
ok then do i have to add a script to every single child of the object to save it? also whats the best way to make functioning items as i said
yes for next time the code is not big you can see the problem @sage mirage
Whats ur problem?
im not asking how to save it i just want to know how to connect all of them to the base ship class, or do i have to
It's the last paragraph
The player doesn't die
Oh shit i didnt read that
Sounds like a physics message issue.
the ship data structure needs to contain each part. Which it should probably do interface. You could also use specific classes to enforce that only a specific type goes into each slot
@acoustic crow does the player have a rigidbody?
but it depends on how interchangeable parts are into slots
no he need one?
Yes
For OnCollisionEnter to work
Well, OR the enemy needs one
Just one of the two
if you use a bunch of specific base classes (eg Rocket, Shield, Door…), then you block the ability to put different types of objects onto the same slot
like if you later change your mind and want to allow putting Fins on the same “slot” as a Door or Thruster, then you fucked yourself if you stored specific variables for each slot.
my game doesnt have slots you can expand the ship infinetly, also with interfaces, how can i make the rockets apply more force when there are multiple boosters
the ship’s data structure should make it easy to query specific types of parts
@summer stump okey the player have now a rigidbody and i make rb.gravityScale = 0f; that the ball dont fall
the ship’s data structure doesn’t actually do any physics. No game logic. At all, period.
but id dosent work
Hungriger....
yes i said that in the text
it’s one and only job is to store a representation of the ship, with references to specific parts, and let tou query to know what you have
thats what im asking how can i do it
That seems to be what they wanted
i’m explaining to you to use interfaces lol
Check the tags
Best to use CompareTag
you need a separate monobehaviour that takes in a ShipData and actually does game logic, like determining force vector from thrusters etc
he have the tags
but you can’t do any of that until you make a data structure for your ship
Alright, start putting Debug.Logs throughout the code. See where the issue is exactly
which should primarily contain simpler data structures of IShipPart, or whatever interface
thats what im asking
the details depend on how the ship is structured
if it is like the GumiShip from kingdom hearts, I would have an IShipPart[,,]
ok so for example if my rockets fire when the w key is pressed, should i loop through every shippart and fire the interface
No?
I feel like an event being triggered that the main ship could listen for would be better
if your ship is like zoids, where specific slots on the zoid can only house specific types of components, then these would probably be different specific variables, each of which have an IZoidComponent
because the big gun slot of a zoid cannot have a rocket, for example
any component can be placed anywhere
the monoscript that interprets the ship’s data structure is responsible for figuring out how to query
you could even store a sparse matrix like List<Tuple<int, int, int, IShipPart>> (but Tuples are not serializable, lol)
i would look through all the parts in the ship, and cache what I find for specific things that I need direct references to. Such as a List<Rocket>, which gets populated each time I go across a rocket
does this make sense
you want to separate the serializable data structure from the monoscript that does logic
data structure’s job is to hold data, and know how different parts can be stored/placed on the ship.
Logic monobehaviour’s job is to look at the ship data, and know what to do.
ok im asking how to make the logic
fixed it nvm
Trying to get the main camera to render all the trees, but I can't seem to. I tried making a script to force the draw distance to be a certain value but some trees still don't show up even after inputting distance values in the ten thousands range
The far bit of the main camera is also within this range
Hi, I'm actually trying to create a car driving system, everything works but I have a problem: my car's front wheels align to the direction the user wants to steer (and it works) but I can't make the wheels "roll" anymore
you are using Lerp in a wrong way
not related to the issue probably
but still, that's a wrong way to lerp properly
the last parameter is interpolation point
Oh, thank you
Is there a way to rotate terrain details, like grass?
yeah goodluck getting spambot to do something useful
sorry
To tell you the truth chat is useful sometimes but not always so don't undervalue it.
Use https://streamable.com . . .
You have basically to use all the information you have to get help from it
With limited info it won't help a lot
Im perfectly aware of its capabilities, and point still stands
You can literally give it all your script and still wont have a clue what to do
Because it is a machine like every machine that learn from data.
an LLM is NOT a think machine
its simple pattern matching
it doesn't have actual thought or foresight
Now, I am dealing with an error that neither chat was able to find the solution. It recommend me to do some modifications but nothing changed actually. So, check here my screenshot
and you're surprised ?
No a lot to tell you the truth
my visual isnt detecting the c# lenguage. Whats the extension i need to download? it dont even show the errors
Find it more useful to get help here
Looks like you probably destroyed your pooled object instead of returning it to the pool
!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
• Other/None
Give me a minute to send code
{
if (other.gameObject.CompareTag("Gem"))
{
CollectObject(other.gameObject);
// Instantiate gem particle effect
GameObject gemParticle = GetPooledObject(gemParticlePool);
// Check if a gem particle was successfully retrieved from the pool
if (gemParticle != null)
{
// Set the position and activate the gem particle
gemParticle.transform.position = other.transform.position;
gemParticle.SetActive(true);
Debug.Log($"{name}Gem particle not found!", gameObject);
}
}```
or you know, actually start learning what you're doing instead of relying on GPT so when something breaks you have a clue where to start debugging
i just started game dev in unity and I am trying to make a save system for my proceadually generated world and I am thinking of having all game obj being set as a child to a empty game object and the saving the size ,rotation ect: of the empty game obj would that work or do i need to do something completely different? becuase idk if that would work ...
You wont learn from chat I understood that at the beginning
store the data in a plai old object
serialize it, and done
You just ask for the solution
That way you wont learn to solve errors and different issues on your own
#📖┃code-of-conduct
Against the rules to use chatgpt for answers. Anyone can ask it themselves (and get crap as a result), so no one really needs you to ask it for them
so how would i store it.
I mean this code doesn't tell us anything new or change what I think your problem is. The problem also wouldn't be here it would be where you destroy or return the object to the pool
such a bad way of thinking. Hopefully you will learn soon enough
Wdym?
*as I said i am kinda new and i dont know how i would store in the obj and what method i should use to save it so it might seem simple to u but i have like 0 idea 💀
first create an Object that has the data you want to save.
Yeah the error is at line 138 thats why I sent that.
38 and 36 sorry
138 and 186 sorry
XD
to create an Object in c# you do cs public class PlayerData{ public string Name; public int XP; }
for example
Yeah i could look at that and through a tutorial get that down
but i am trying to save procedealy generated world and building placement for an rts
working on a newer one myself 😛
but if you look online plenty of resources
inconsequential to the process tbh
its all the same, procedual or not.
then, tbh, you are in completely over your head, start with something simpler
rts def might be a bit of "biting off more than you can chew"
fine enough.
might want to dive into some c# fundamentals first though
true that
just try to save and load anything, then move on from there
like data eg: player xp and lvl ect:?
what else?
wdym
there is nothing other than data to save and load
how about a high-score file. store a username and a score.,
yeah but the root cause of the error is elsewhere
so how to rts ppl make rts games.....
with deep knowledge ?
Do you have time please to make a thread now and help me maybe fix the issue? I am going to send you in thread all information needed. But before making that thread let me check it one more time or two maybe i fixed it.
by having lots of experience
I shown you example
yep
ok ima just gain deep knowledge ig
by having 23413131 grueling years or practise
the answer for that is prolly to extensive for this place..
if you dont start you never gonna gain the XP
true
procrastination wont get you far lol
I'd suggest you start with a simpler concept than RTS. somthing like "asteroids", to get that XP
mhmm
asteroids is a "drop in the bucket" comapred to the work required to make a real time strat gae
mhmm ok
@wintry quarry Problem is fixed I have checked it second time and found out what was causing the issue. Thanks! No need for threads for now.
No one is saying "don't make an RTS"
They are saying learn the fundamentals first
Start with making a ball roll.
Then make something chase the ball.
Make BrickBreaker
Make Battleship
Make a simple platformer
Work your way up, learn as you go, get experience, then you will be ready for an RTS
Also don't ignore the prototyping stage
RTS is fairly high in complexity
You can make projects just to do one facet of the game and learn from that
would want other thigns under the belt first
also don't start with your dream first games are about learning more then anything
so like make 3 simple projects
3 advanced
for an eg
and then jump to something a bit more complex or sum
no one can say, you will feel it out yourself
or things of smaller scope that share common features to what you want to eventually do
true
so do a project that focuses on procedeal gen
and then based on animation
ect
a simple game that a bot AI runs around and grabs fruit or something
to build up core features for the game
the number of projects does not matter, it's if you learn anything from them . . .
very true
wait someone just sent me dis on sum gc when i asked same ting
If you're procedurally generating, then track the data you're using to generate. Then you can save those instructions to execute again later.
If the world is destructible, that complicates things.
Saving the type of the objects, seeds and their transforms can be fine enough, it really depends on the functionality of your system.
There's third party tools that can serialize the whole scene, but this is not ideal from a storage or update capability perspective.
yeah ima stick with a simple fundemental project....
I recently started unity how do i get better aat unity
practice
!learn
:teacher: Unity Learn ↗
Over 750 hours of free live and on-demand learning content for all levels of experience!
practice, push yourself
I know how to use box colider, tags, simple ai , simple simple raycasts, moderate blender skills so I think I should keep adding skills to my toolbox till I am ready to proceed with my main /goal / dream game and you should do the same!
Yo ! When pressing the attack button I want to be able to move for 1 second, after the second passed I want to be unable to move. How can I achieve that ? I tried using WaitForSeconds, but it doesn't work as intended (and it's normal)
show what you tried
i need someway to have like a update function that i can put into every script and on one script call them all
!code
📃 Large Code Blocks
Use links to services like:
https://gdl.space/, https://paste.ofcode.org/, https://hatebin.com/, https://paste.myst.rs/, https://hastebin.com/
📃 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.
maybe an event would work
this needs to get called 60 times a sec would it still work?
I can't really show my code because it's not a simple function. But it's something like this :
private void f1()
{
StartCoroutine(f2());
}
private IEnumerator f2()
{
// allow movement
yield return new WaitForSeconds(1f);
// prevent movement
}
But if i'm not mistaken, what it's doing is. Allow movement then wait 1 second and prevent movement. Not, allow movement for 1 second then prevent it
!code
📃 Large Code Blocks
Use links to services like:
https://gdl.space/, https://paste.ofcode.org/, https://hatebin.com/, https://paste.myst.rs/, https://hastebin.com/
📃 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 code looks fine. Show your real code if you want better/accurate responses and advice
yeah ofc
well not sure what your use case is though, it might not be the best option..
The real code isn't what I told in my message and it's calling other script. That's why I don't want to show it. But if you tell me the code is fine it's probable that the problem is something else. Thanks for the help !
well the real code could certainly have a problem
this is missing a lot of context
Yes I know but that's fine, I will find it myself. You will need to read to much line for a simple problem don't want to bother you
Help me out here. I watched GMTK’s video on a mini game and how to make it and I understood most of it but I had some questions:
-
What does transform.position do?
-
What do the different types of vectors (like vector3)?
I’ll come back if I have more questions
Thanks !
Hello
- It's a property that allows you to get or set the position of an object.
- This isn't a full english sentence/question
Should i learn c# with Unity or learn c# first without unity lib
I recommend the latter tbh
Oh yeah my bad the question was what do different types of vectors do? Like vector3
they don't do anything. They just hold information
do both. But doing it without worrying about UI or extra APIs is cleaner learning to absorb the basics.
Example the C# Console application can teach a lot and its quick to compile/ test code
Oh thank you this is extremely useful
A Vector3 is simply a collection of three float variables named x, y, and z
they can mean different things in different contexts
for example it might be representing a position, or maybe a set of rotations around world axes
the unity documentation covers the core unity API. make sure to bookmark it and keep it open during development. go ahead and look up the vectors you asked about . . .
https://gdl.space/kukogivuga.cs what detects if player should become invincible, relevant: Line 74 and 313
https://gdl.space/gacukeciyu.cs health script
https://gdl.space/yokedaquyu.cpp player collision just in case
problem: idk im unable to figure out how to stack the animations properly
Also should I be using tutorials?
so you solved your earlier issue ?
Cause I’ve heard people say they don’t help
you have to learn somehow . . .
that one was due to spelling error
but i got this one now
which is similiar
i think
ok then..
Guys what this guy talking about the awful changes
everyone has a different experience. two people learning the same thing can have separate outcomes . . .
Those changes were reversed
misinformed tool
So would you recommend it?
Watching Tutorials for specific things
Like idk how to code 2d movement should I copy paste someone’s code?
do your proper research, don't just believe everything someone tells you . They're talking out their ass
So which better to start with
I ll do thx
IMO unity is the easiest..
but everyone is different
try out yourself, they're all just tools for the same job
Yes so i m just looking for the easiest one
its subjective to some extent
They say that godot gives free themes
what about current problem? 😮
and whats that : )
free themes? I rather not care about that lol
I care that Unity also has a vast variety and amount of free assets on asset store
and about the awful changed which idk it , what did unity change ?
really, that is a priority for you?
Idk whats the themes he talks about
just pick an engine and run with it. this is not smth you should worry about if you're just learning . . .
its something can use on game dev ?
If you make a million dollars in a year and a million downloads, you have to pay 2.5% revenue, which is half of what unreal does.
Very awful changes indeed
or just the engine style