#💻┃code-beginner

1 messages · Page 215 of 1

wintry quarry
#

Depends which form you use

#

For the int form, it will not

brazen narwhal
#

yea int

wintry quarry
#

for the float form, it will (though very unlikely)

brazen narwhal
#

that's good to know

wintry quarry
brazen narwhal
#

thanks

wintry quarry
#

you can always check the docs for this kind of thing

brazen narwhal
#

yea true

#

my bad

craggy oxide
#

woohoo it works

#

that is actually so cool

#

custom gravity

#

this opens up a whole bunch of doors

#

thank you praetor and others

ashen trail
#

is there anything wrong here?

wintry quarry
#

that's the main problem

#

Get it configured
!ide

eternal falconBOT
wintry quarry
#

I can tell because despite the obvious errors in your code, there is no error underlined/highlighted.

static cedar
wintry quarry
ashen trail
wintry quarry
ashen trail
#

really helpfull thx

ashen trail
ashen trail
#

thx

rose imp
#

Has anyone used boat attack to get assets? Any tips on how to get it to download?

rose imp
#

thats what im trying to do, but I am unfamiliar with how the GIT works

stone elk
#

is joyStick.gameObject.SetActive(true); the best way to enable and disable my joystick?

wintry quarry
#

it's unclear what type joyStick is though

stone elk
#

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?

wintry quarry
#

sure it makes sense but I still don't know what you mean by "best way"

#

that will deactivate the object

stone elk
#

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?

wintry quarry
#

what's wrong with what you have?

stone elk
#

its works. i feel like it would probably look better without it in the way.

wintry quarry
#

So if it works what's the issue?

stone elk
#

i want it to be invisible when i reactivate it so it is still usable.

#

sorry if my explanation is not very good

wintry quarry
#

Do you understand the difference between a GameObject and the components on the object?

stone elk
#

components is the things inside the gameobject i think like the scripts.

wintry quarry
#

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

stone elk
#

ill try that

wintry quarry
#

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.

stone elk
#

but when i activate it, i can see it, wich is what i dont want

#

that makes more sense?

wintry quarry
#

or set their alpha to 0

#

that's a completely separate thing from activating/deactivating it

stone elk
#

ill try disabling the script instead of the gameObject

#

think that'll work?

wintry quarry
#

I don't even know which script you're talking about

wintry quarry
stone elk
#

are you talking about the code that i showed above?

wintry quarry
#

which code?

#

The SetActive line?

#

I'm not talking about any code

stone elk
#

yeah

#

but i need the component

wintry quarry
#

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

stone elk
#

ill just try to see if i can fix it on my own. if that doesnt work, ill try doing what you said before.

rose imp
wintry quarry
#

BoatAttack is an existing project

#

it wouldn't be a new project you are creating

stone elk
wintry quarry
stone elk
wintry quarry
#

what it's made of

#

how it's rendered

#

etc.

#

presumably there's either an Image component or SpriteRenderer

stone elk
#

its a floating joystick.

#

its an image

wintry quarry
#

ok so set the alpha on the image to 0

#

now it's invisible

timber comet
stone elk
#

i get it now. that could work

timber comet
#

Its bad on performance (IF NOT WRONG)

wintry quarry
#

I mean everything affects performance but you need what you need

stone elk
#

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

timber comet
wintry quarry
#

is it going to bring the game to its knees?

#

There's no need to be concerned here

timber comet
wintry quarry
#

everything is a tradeoff.

#

It's not worth spending a lot of effort to shave 1 nanosecond of performance out.

rose imp
wintry quarry
#

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.

fickle plume
#

Also disabling/enabling objects on canvas can be much costlier, because it will update everything on the canvas.

fickle plume
#

Just hiding from view is more performant

rose imp
wintry quarry
#

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

rose imp
wintry quarry
#

Yes you should be showing what you tried and asking clarifying questions

lavish gate
#

using singletons, throwing a null reference exception when its called, causes?

wintry quarry
#

first step is identifying which field is null

lavish gate
#

Its saying no when i call the method inside the singleton

wintry quarry
wintry quarry
#

i.e. your instance field or whatever

lavish gate
#

Ah yeah need to initialize it

#

oopsie

#

thanks for your help

faint sluice
#

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?

wintry quarry
#

it is perfectly deterministic

faint sluice
rose imp
faint sluice
#

Idk why I always thought floating point errors are kind of random and everytime it will be slightly different

wintry quarry
#

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:

wintry quarry
#

not just the url

lavish gate
#

gh repo clone {the link}

rose imp
#

you are all incredibly patient and I appreciate you

wintry quarry
#

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?

rose imp
#

this looks better, is it right?

#

or should i use this?

wintry quarry
#

you should merely be cloning a repository

mossy sphinx
#

!code

eternal falconBOT
quartz mural
#

Can someone help me debug my code

low path
#

Depends, what problem are you having?

rose imp
#

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

gaunt ice
#

download as zip

quartz mural
#

for my coursework

#

during the battle

#

the player is movin in the back

#

and its causin errors

languid spire
#

fix the errors

quartz mural
#

idk how

#

its not syntax

languid spire
#

neither do we as we have not seen either the code nor the errors

quartz mural
teal viper
quartz mural
#

``c
private bool IsWalkable(Vector3 targetPos)
{
if (Physics2D.OverlapCircle(targetPos, 0.2f, GameLayers.i.StuffLayer | GameLayers.i.InteractableLayer) != null)
{
return false;
}
return true;
}

languid spire
#

and that is?

modest dust
#

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)

languid spire
#

@quartz mural you are not going to get any help if you don't answer questions

opaque matrix
#

is there a way to pause an animation and reverse it from the moment it is paused during an execution?

modest dust
#

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

opaque matrix
#

Alright thank you!

calm hull
#

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

rare basin
#

UI is the same in both

#

also not code related question

calm hull
#

oh there is other for ui didnt know

#

ty

true elm
#

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?

hexed terrace
#

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

languid spire
crimson ibex
#

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.

ivory bobcat
#

Lookup a tutorial and try it out

crimson ibex
#

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

true elm
west sonnet
#

Why isn't this working? I'm trying to access a variable from another script on the same object

true elm
#

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.

fresh shell
#

How can I code in a simple Wait(float seconds) function?

languid spire
fresh shell
hexed terrace
ivory bobcat
ivory bobcat
gaunt ice
#

this code does only one thing
yield return a waitforsecond object

crimson ibex
west sonnet
hexed terrace
#

lots of tutorials on that , google -> unity how to reference other objects

languid spire
west sonnet
#

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?

languid spire
#

another transform.parent at the end ?

low path
#

you could just do trasnform.parent.parent.

#

since parent is a transform

west sonnet
#

oh, I see

hearty cargo
#

hey its my day 1 of unity

low path
#

good luck

hearty cargo
#

i was going through a tutorial of unity on youtube

#

a simple one

#

flappy bird

#

but the code isnt working

#

needed help

hexed terrace
#

please type in full sentences

hearty cargo
#

okay sorry

languid spire
hexed terrace
#

When you're following a tutorial, if there's works and yours doesn't.. you did something wrong/ missed something, re-watch the tutorial

ivory bobcat
eternal falconBOT
languid spire
# hearty cargo

spelling mistake in your very first line, these things are important

west sonnet
#

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?#

hexed terrace
#

Don't do all that .parent stuff, use GetComponentInParent<T>()

west sonnet
#

Hmmm, it seems like adding " == true "" has fixed it, I think?

low path
#

you'll learn more and we are just guessing

west sonnet
#

Ookay

#

I'm just very new to Unity, sometimes i don't even know where to begin

low path
#

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

verbal dome
#

if(myBool) is the same as if(myBool == true)

west sonnet
#

Is it possible for me to use the "collision" in my "OnTriggerEnter2D" in my method below?

hearty cargo
#

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

low path
night mural
low path
#

right...

west sonnet
low path
#

it's just a component of an object

low path
#

and yes you need to pass it in. look up variable scope...

ivory bobcat
hearty cargo
#

Is there anything wrong with the code which is causing the keyboard input to not be taken

ivory bobcat
#

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

blissful yacht
#

Does anyone have a yt channel which teaches unity and focuses on teaching unity instead of doing a project

ivory bobcat
eternal falconBOT
#

:teacher: Unity Learn ↗

Over 750 hours of free live and on-demand learning content for all levels of experience!

ivory bobcat
#

It's completely free either way

calm hull
#

where can i ask UI questions

ivory bobcat
#

What kind of ui questions?

#

When in doubt, you can try in #💻┃unity-talk but this would be the beginner coding channel.

calm hull
#

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?

ivory bobcat
calm hull
#

the type is TextMeshPro?

#

@ivory bobcat

hidden sleet
#

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?

https://hastebin.com/share/ukoxowanag.csharp

ivory bobcat
calm hull
#

Great!

#

working now

#

thank you

#

this clone is because its a child class?

ivory bobcat
calm hull
#

im using heritage

#

for that object

#

i cant?

trail heart
calm hull
#

yes

#

how i do it otherway? with a getter?

hidden sleet
#

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

robust hawk
#

Hi blushie

hidden sleet
#

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; } }

hidden sleet
#

Oh i see. What do they mean by the input field of it? I just get it through .text

gaunt ice
#

tmp input field

verbal dome
hidden sleet
#

well that seems to be working now :)

#

what a strange issue

#

no matter

verbal dome
#

Seems kinda annoying, yeah.

hidden sleet
#

Ah the joys of messy code

warm pawn
#

i need help I have all the Transicions set to Condition _example but it only plays one am i doing it wrong?

warm pawn
#

sorry cludnt find it 😄 thx

fervent abyss
#

Hi,

I want to make a Light Flickering effect, and put morse code as flickering.

Whats the best way to do that? Coroutine?

vast sparrow
#

im new to unity and coding is there anything that can help me get more info about the code ?

rare basin
#

yes

#

internet

#

and google

foggy magnet
young warren
#

there's no way to verify the answers it gives

foggy magnet
#

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

foggy magnet
young warren
#

they don't

foggy magnet
#

Yes, but doesn't thaat apply also to stack overflow, or random git projects, or googling. Or, the Unity documentaiton also 🙂

young warren
#

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

young warren
#

!learn

eternal falconBOT
#

:teacher: Unity Learn ↗

Over 750 hours of free live and on-demand learning content for all levels of experience!

foggy magnet
#

Look like you have two suggestions here then rocksys 🙂

languid spire
cosmic dagger
foggy magnet
# young warren if you really want to compare answers given by a community that is open for disc...

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.

rare basin
languid spire
#

absolutely, if a junior of mine was caught using AI he would be looking for a new job

rare basin
#

same

#

well, depends on what

#

if for some data comparision for exmaple, then sure

#

but for coding? cya

foggy magnet
#

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.

rare basin
#

sure

languid spire
rare basin
#

im just feeling sorry for that juniors thinking they are learning the proper way

#

that's all

foggy magnet
rare basin
#

imagine having Senior above you, and he's ordering you to learn from chat gpt

#

absolutely ridicilous

foggy magnet
rare basin
#

Sure just expressed my opinion

#

if chat gpt code is good for you

#

then alright i wont argue

foggy magnet
#

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.

languid spire
cosmic dagger
# foggy magnet I find ChatGTP is really helpfull, just paste small or large bits of code in and...

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 . . .

foggy magnet
static cedar
foggy magnet
undone rampart
foggy magnet
#

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.

undone rampart
dense nest
#

Anyone know how can I send heart rate data to Unity with polar chest strap?

languid spire
dense nest
languid spire
#

you need to know

rocky canyon
#

its a bluetooth device, theres a github repo for getting inputs in unity for the H7

dense nest
#

I asked gemini and it told me to use Excite-O-Meter plugin

strong wren
#

Figuring out a way to get that information to a PC would be a good start. From there you can work backwards.

dense nest
#

there's even github link to the code, i'll read it

dense nest
rocky canyon
#

its the first result in google

#

has a link to the github

dense nest
#

ok thx

#

i'll try checking it out

buoyant forge
#

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 ?...

polar acorn
#

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

foggy magnet
polar acorn
foggy magnet
#

oh right, i see what you mean now 🙂

polar acorn
#

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

cosmic dagger
foggy magnet
#

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.

polar acorn
foggy magnet
#

I love how it it mentioned the link to stackoverflow though

low path
#

i mean... there's no reason a "complex" or "exponentiation" class needs to derive from monobehaviour to be fair

foggy magnet
low path
#

also not sure why you'd give the exponentiatoin function an entire class itself...

foggy magnet
#

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

foggy magnet
cosmic dagger
low path
#

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

cosmic dagger
#

because a beginner in the chat was asking for learning material and where to get started . . .

polar acorn
#

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

foggy magnet
# cosmic dagger true, but how would a beginner understand this or implement it? someone already ...

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.

low path
#

i think the best you could say about it is it's a good natural language search engine

rocky canyon
#

id feel shafted as a jr being told to use chatgpt.. imho

foggy magnet
# low path i think the best we could say is that chatgpt gives plausible results if you kno...

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.

foggy magnet
west sonnet
#

Can ya'll please help me understand this error message? I'm trying to pass the "collision" from the OnTriggerEnter2D into the PunchEnemyKickBack() Method

hexed terrace
#

you've left the param to send blank

gaunt ice
#

Collider2D is not Collision

undone rampart
foggy magnet
# undone rampart i dont see a problem for a junior to use chatGPT, as long as he knows how progra...

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.

nimble jacinth
polar acorn
foggy magnet
nimble jacinth
languid spire
undone rampart
# polar acorn If they know how to program, they likely don't need it

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

foggy magnet
#

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 🙂

nimble jacinth
#

firstly, you sound like a nun and secondly where do i ask questions for basic and common knowledge

foggy magnet
rocky canyon
#

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

foggy magnet
nimble jacinth
rocky canyon
#

how often do u communicate with nuns?

#

sounds prejudice to me

nimble jacinth
rocky canyon
#

ahh gotcha

#

ruler to the hand punishments for u i bet

nimble jacinth
#

where do i ask questions about unity's mesh filter thingy

rocky canyon
#

if its code related here..

hexed terrace
#

in the channel appropriate for it, this is a code channel. Use id:browse to find one

rocky canyon
frigid sequoia
rocky canyon
#

shitty tutors then 😄

undone rampart
rocky canyon
#

being self taught solo dev is alot different then working under a Sr

undone rampart
rocky canyon
#

cool, keep it up 👍 knowing both engines is good stuff

undone rampart
#

eh, i dont rly like unreal, i only use it cuz its my job, unity will always be the one i want to master

rocky canyon
#

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

hexed terrace
#

getting waaay off topic now

earnest atlas
#

If you subscribe to a function inside an object that gets destroyed then you must add OnDestroy code to unsubscribe the functions?

rare basin
#

usually yes

#

onenable - subscribe, ondisable - unsusbrice for example

earnest atlas
#

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?

gaunt ice
#

just check if it is null

rare basin
#

or test yourself

#

in 1minute

earnest atlas
#

Im kinda not at pc atm. Im just gonna leave it on destroy

earnest atlas
rare basin
#

dont use anonymous functions then

earnest atlas
#

_initializedObjects.RemoveAll(obj => obj.gameObject == null);

will this clean null objects

rare basin
glossy eagle
#

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;
}
cosmic dagger
#

Is the file name the same as the class name?

glossy eagle
#

oh so I can't change the name of the scriptable object asset? Because that is what seems to be breaking it

languid spire
#

that is not what the error is saying

glossy eagle
#

well but not changing the name seems to fix it lol

languid spire
#

the name of the asset bears no relationship to the type of the asset

glossy eagle
#

I do get this error tho, but I can just remove it and continue

gaunt ice
#

what is the whole stacktrace?
your code or unity?

blazing estuary
#

how to check for a collision with a specific tag in OnCollision Enter()

languid spire
#

check the tag

blazing estuary
blazing estuary
cosmic dagger
glossy eagle
languid spire
cosmic dagger
rare basin
#

lol

blazing estuary
#

hey it works

#

nice

#

i found it in a unity discussion

languid spire
# blazing estuary 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

cosmic dagger
earnest atlas
#
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

earnest atlas
#

Some serialization issues I guess

wintry quarry
#

you would have to do a reverse iteration to reliably remove things this way

earnest atlas
#

Yeah

#

I remembe rnow

#

Tho it doesnt really matter

wintry quarry
#

likewise you could also do:

_inializedObjects.RemoveAll(o => o == null);```
earnest atlas
#

only one object at a time gets destroyed

#

I had this before and it didnt work and debugger couldnt show me steps on lambda

wintry quarry
#

there's no reason a debugger wouldn't be able to step on the lambda

earnest atlas
#

It tells me its outside the environment

wintry quarry
#

what tells you that

earnest atlas
#

the visual studio points of intrupt

wintry quarry
#

if you want to really make it debuggable do this:

bool Remover(UnityEngine.Object o) {
  return o == null;
}
_inializedObjects.RemoveAll(Remover);```
earnest atlas
#

Im not sure what happend but I cant turn my Scene perspective?

wintry quarry
#

What's stopping you?

earnest atlas
#

it just gone

#

the axys on the top righ

wintry quarry
#

Are you in 2D mode?

earnest atlas
#

gonna restart it and see if it comes abck

#

No idea if I am,

wintry quarry
#

The 2D button will be highlighted

vast vessel
#

is there a difference between returning true and false or null in a coroutine?

naive lion
#

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

earnest atlas
wintry quarry
#

The only special things Unity is looking for from a coroutine are YieldInstructions and CustomYieldInstructions

buoyant knot
summer stump
#

This is... a bit off-topic here.

Post to the wrong server by accident?

earnest atlas
#

yes

low path
#

lol

earnest atlas
#

lmao

low path
#

good game tho

earnest atlas
#

it is

low path
# naive lion hey guys, im currently working on implementing a tutorial or level progression s...

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...

earnest atlas
#
 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
rare basin
#

that wont work

#

think about it

#

you are modiyfing the collection

#

when iterating over it

#

reverse the for loop

wintry quarry
#

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?

earnest atlas
#

because destroyed object has no reference to the objective and objective has them objects serialized

wintry quarry
#

have an event listener remove it

earnest atlas
#

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?

wintry quarry
rare basin
#

you should remove it from the list aswell, not only Destory() the object

earnest atlas
#

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

rare basin
#

that doesnt sound good

earnest atlas
#

pass the game object instance with event and just delete the object like that?

summer stump
wintry quarry
#
public delegate void EnemyDiedHandler(Enemy source);
public static event EnemyDiedHandler OnEnemyDied;

public void Die() {
  OnEnemyDied?.Invoke(this);
  Destroy(gameObject);
}```
rare basin
#

isn't Action<Enemy> OnEnemyDied just simplier?

earnest atlas
#

Not sure why delegate here?

wintry quarry
#

I always prefer custom delegate types for clarity, but it's a personal preference

low path
#

events need delegates

earnest atlas
#

I did not use delegate for events?

rare basin
wintry quarry
earnest atlas
#

private Action<float> _function;

wintry quarry
#

the only thing I did you might not be used to here is define a custom delegate type

wintry quarry
low path
#

Action<float> is a built in delegate

earnest atlas
#

Ah

wintry quarry
#

so you did indeed use delegates

earnest atlas
#

I ment delegate name

wintry quarry
#

right as I said, it's just a preference. It's not that important to the point of this

#

which is to use events

rare basin
low path
#

if you want each one to have its own set of callbacks, it can't be static

wintry quarry
wintry quarry
#

sure

earnest atlas
#

Should I pass enemy or gameObject?

wintry quarry
#

but I don't see that as a requirement in general

rare basin
#

so that each instance of my enemy has his own OnDied action

#

yea im just asking 😄

wintry quarry
earnest atlas
#

as of now Im storing gameobject

#

Okey

rare basin
#

let's say I have ScoreManager (singleton) and want to increase the score each time an enemy dies

low path
#

this is like the perpetual discussion re the "simplicity" of globals

rare basin
#

but i don't have static OnEnemyDie event

#

each enemy has his own callback

earnest atlas
#

Will this do?

rare basin
#

whenever spawning enemy i should add AddScore() from ScoreManager to OnDie event?

low path
#

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...

low path
#

it's more work to plumb all the stuff like that

rare basin
#

i was tihknig it othey way around

#

so each enemy hooks to the scoer manager

earnest atlas
#

Are events better then checking on fixedupdate?

low path
#

the reason you use events is to decouple stuff

low path
#

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

rare basin
#

so i should have ScoreManager that has a reference to EnemiesManager

low path
#

because then every time you make a new type of peripheral thing you have to change all your main stuff

rare basin
#

and EnemiesManager should have a list of enemies

#

and OnEnemyAdd callback

low path
#

that's what i would do

rare basin
#

and in ScoreManagre you listen to OnEnemyAdd from EnemiesManager

#

right?

low path
#

yes that's what i would do

rare basin
#

seems nice and clean

#

thanks

low path
#

to me that is the cleanest way

earnest atlas
#

I have score in GameManager.

#

With most of events

rare basin
#

you shold follow single-responsibility rule

#

instead of making one big GameManager

#

for everything

earnest atlas
#

Its not that big

#

136 lines

low path
#

it's not big now

earnest atlas
#

And most of it are storage

rare basin
#

that's not relevant

#

to what i said

earnest atlas
#

I know i did that

rare basin
#

single-responsibility

earnest atlas
#

Where I needed

low path
#

i mean.. it's fine to have a 136 line class like that

earnest atlas
low path
#

but i think at some point if it gets significantly bigger, you will probably want to refactor...

earnest atlas
#

yeah its just too small to make 4 different classes

rare basin
#

that's a bad assumption

low path
#

oh but you do have four different classes

earnest atlas
#

because those scripts have quite different roles and are more complex then data storage

rare basin
#

then why is it called GameManager

#

when it's a DataStorage

earnest atlas
#

It got its name as inheritance from my previus project from where I yoinked it

#

its like generation 3

tawdry rock
#

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.

young warren
tawdry rock
#

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;
}
`

earnest atlas
#
 private void OnKillsBasedLogic([CanBeNull] EnemyController enemy)```

Why ? becomes can be null?
polar acorn
#

Can you rephrase that question

earnest atlas
#

I tried placing EnemyController? but it automatically becomes CanBeNull

wintry quarry
#

I guess you're saying your IDE added that attribute?

#

It's not that important

earnest atlas
#

yes

wintry quarry
#

it's just telling you the parameter can be null

#

you can delete it if you want

earnest atlas
#

Well i want it there

rare basin
#

then leave it

quartz grove
#

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

pine bone
#

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?

eternal falconBOT
#

:teacher: Unity Learn ↗

Over 750 hours of free live and on-demand learning content for all levels of experience!

sage mirage
#

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.

wintry quarry
queen adder
#

Could u share a screenshot?

sage mirage
#

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.

summer stump
#

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

queen adder
#

I feel like it should be more obvious in the Editor UI lmao thats so ez to miss lmao

sage mirage
#

I dont see it on my console btw

queen adder
#

Click on the Red Icon

sage mirage
#

when I disable my messages then I see it

#

I did that

queen adder
#

In the Console

summer stump
sage mirage
#

I mean I have to disable the messages first

queen adder
#

Share a new Screenshot so we can confirm

sage mirage
#

otherwise I see no error message

#

I scroll it up and down

#

and nothing

summer stump
summer stump
sage mirage
#

I have prefabs

summer stump
#

What.....?

sage mirage
#

I have them as prefabs

summer stump
sage mirage
#

Logs and other game objects I want to instantiate

summer stump
queen adder
#

Oh u mean u print something in the console when u spawn something?

summer stump
#

That makes no sense

sage mirage
#

I have my logs as prefabs

slender nymph
#

do you mean logs as in like from a tree

queen adder
buoyant knot
# pine bone Hello guys, i have a question about making my build system. I have a 2d game whe...

You will need:

  1. 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.
  2. 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.
  3. 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.
  4. 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.

sage mirage
#

logs for my flappy bird game

#

XD

#

No console logs

#

XDF

queen adder
#

Eithr way....

summer stump
#

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

queen adder
#

Ur warnings were turned off

#

Just turn them back on and maybe stop putting so much into ur console

sage mirage
#

Have you played flappy bird ever?

#

XD

summer stump
queen adder
#

Flappy bird doesnt have logs?????

#

Its a bird going thru mario pipes?????

sage mirage
summer stump
sage mirage
#

I am a serious guy and try to make something

#

I am here to get help

#

I dont want to waste my time

pine bone
sage mirage
#

by trolling

buoyant knot
pine bone
queen adder
#

Pretty much

#

Share a screen shot of a updated console

pine bone
buoyant knot
#

do you know what an interface is

sage mirage
#

So I have to disable messages and warning and then I will see the errors?

#

Thats what I did

summer stump
queen adder
#

You have to enable them

sage mirage
#

I disable messages but not warnings and only leave error enabled and it worked

summer stump
#

If errors are not disabled, then they will be there

sage mirage
#

I saw the error

#

oh ok

queen adder
#

Just turn them all on

sage mirage
#

I mean

pine bone
buoyant knot
#

and you know what it means for a class to be serializable

sage mirage
#

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

pine bone
summer stump
queen adder
#

Can u see the error?

sage mirage
#

Maybe I miss something because there are 999 messagves

summer stump
buoyant knot
queen adder
#

If ur logging to ur console every frame ur not going to see 1 error message out of 1000 messages

sage mirage
#

I have to clean up my code a little bit yeah

queen adder
#

Turn off the constant logging

sage mirage
#

Thats what I am going to do

buoyant knot
#

unity inspector just tries to show entries in inspector view for things that are serializable, if it can

summer stump
#

You can also collapse the console messages
You don't want to always do that though

pine bone
buoyant knot
#

classes/structs/etc that are not serializable cannot be saved in a simple way

acoustic crow
#

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.

buoyant knot
eternal falconBOT
queen adder
#

ChatGPT helps with Languages to?

#

Thats actually sick

buoyant knot
#

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

pine bone
acoustic crow
#

yes for next time the code is not big you can see the problem @sage mirage

buoyant knot
#

that’s why I say to use an interface

#

ISaveableShipPart or something

queen adder
#

Whats ur problem?

pine bone
queen adder
#

Hungriger

#

Is it the Movement? The Camera? The Trigger?

summer stump
#

The player doesn't die

queen adder
#

Oh shit i didnt read that

summer stump
#

Sounds like a physics message issue.

buoyant knot
#

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

summer stump
#

@acoustic crow does the player have a rigidbody?

buoyant knot
#

but it depends on how interchangeable parts are into slots

acoustic crow
#

no he need one?

summer stump
#

For OnCollisionEnter to work

#

Well, OR the enemy needs one

#

Just one of the two

buoyant knot
#

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

queen adder
#

Does the player have a collider and does the enemy have one?

#

Double check the tags

buoyant knot
#

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.

pine bone
buoyant knot
#

the ship’s data structure should make it easy to query specific types of parts

acoustic crow
#

@summer stump okey the player have now a rigidbody and i make rb.gravityScale = 0f; that the ball dont fall

buoyant knot
#

the ship’s data structure doesn’t actually do any physics. No game logic. At all, period.

acoustic crow
#

but id dosent work

queen adder
#

Hungriger....

acoustic crow
buoyant knot
#

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

queen adder
#

U set the gravity to 0

#

Meaning theres no gravity

pine bone
summer stump
buoyant knot
#

i’m explaining to you to use interfaces lol

summer stump
queen adder
#

Oh shit im so dumb

#

I cannot read for some reason

buoyant knot
#

you need a separate monobehaviour that takes in a ShipData and actually does game logic, like determining force vector from thrusters etc

acoustic crow
#

he have the tags

buoyant knot
#

but you can’t do any of that until you make a data structure for your ship

summer stump
buoyant knot
#

which should primarily contain simpler data structures of IShipPart, or whatever interface

buoyant knot
#

the details depend on how the ship is structured

#

if it is like the GumiShip from kingdom hearts, I would have an IShipPart[,,]

pine bone
queen adder
#

No?

#

I feel like an event being triggered that the main ship could listen for would be better

buoyant knot
#

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

pine bone
buoyant knot
#

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.

pine bone
#

ok im asking how to make the logic

fading rapids
#

fixed it nvm

opaque fox
#

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

grim raft
#

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

rare basin
#

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

grim raft
#

Oh, thank you

plucky moth
#

wow

#

i made big progres

#

im really happy

polar ermine
#

Is there a way to rotate terrain details, like grass?

plucky moth
#

chat gpt !

#

i past you on pv

#

its long

polar ermine
#

Oh ok

#

Chatgpt doesnt undertand this quastion

rich adder
#

yeah goodluck getting spambot to do something useful

plucky moth
#

sorry

sage mirage
sage mirage
#

You have basically to use all the information you have to get help from it

#

With limited info it won't help a lot

rich adder
rich adder
sage mirage
#

Because it is a machine like every machine that learn from data.

rich adder
#

an LLM is NOT a think machine

#

its simple pattern matching

#

it doesn't have actual thought or foresight

sage mirage
#

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

sage mirage
#

No a lot to tell you the truth

calm hull
#

my visual isnt detecting the c# lenguage. Whats the extension i need to download? it dont even show the errors

sage mirage
#

Find it more useful to get help here

wintry quarry
eternal falconBOT
sage mirage
#
 {
     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);
         }   

     }```
rich adder
hearty trout
#

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 ...

sage mirage
rich adder
#

serialize it, and done

sage mirage
#

You just ask for the solution

#

That way you wont learn to solve errors and different issues on your own

summer stump
hearty trout
#

so how would i store it.

wintry quarry
# sage mirage Give me a minute to send code

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

rich adder
hearty trout
rich adder
sage mirage
#

38 and 36 sorry

#

138 and 186 sorry

#

XD

rich adder
#

for example

hearty trout
#

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

rich adder
rich adder
#

its all the same, procedual or not.

languid spire
rich adder
#

rts def might be a bit of "biting off more than you can chew"

hearty trout
#

ima remove the procedealy generated landscape

#

but i stil wanna make an rts

rich adder
#

fine enough.
might want to dive into some c# fundamentals first though

hearty trout
#

true that

languid spire
#

just try to save and load anything, then move on from there

hearty trout
#

like data eg: player xp and lvl ect:?

languid spire
#

what else?

hearty trout
#

wdym

languid spire
#

there is nothing other than data to save and load

sharp wyvern
wintry quarry
hearty trout
#

so how to rts ppl make rts games.....

rich adder
#

with deep knowledge ?

sage mirage
languid spire
rich adder
hearty trout
#

yep

#

ok ima just gain deep knowledge ig

#

by having 23413131 grueling years or practise

sharp wyvern
rich adder
hearty trout
#

true

rich adder
#

procrastination wont get you far lol

sharp wyvern
#

I'd suggest you start with a simpler concept than RTS. somthing like "asteroids", to get that XP

hearty trout
#

mhmm

sharp wyvern
#

asteroids is a "drop in the bucket" comapred to the work required to make a real time strat gae

hearty trout
#

mhmm ok

sage mirage
#

@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.

summer stump
# hearty trout mhmm

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

shell sorrel
#

RTS is fairly high in complexity

summer stump
#

You can make projects just to do one facet of the game and learn from that

shell sorrel
#

would want other thigns under the belt first

hearty trout
#

kk

#

I understand

shell sorrel
#

also don't start with your dream first games are about learning more then anything

hearty trout
#

so like make 3 simple projects

#

3 advanced

#

for an eg

#

and then jump to something a bit more complex or sum

rich adder
#

no one can say, you will feel it out yourself

shell sorrel
#

or things of smaller scope that share common features to what you want to eventually do

hearty trout
#

true

#

so do a project that focuses on procedeal gen

#

and then based on animation

#

ect

rich adder
#

a simple game that a bot AI runs around and grabs fruit or something

hearty trout
#

to build up core features for the game

cosmic dagger
hearty trout
#

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....

queen adder
#

I recently started unity how do i get better aat unity

wintry quarry
eternal falconBOT
#

:teacher: Unity Learn ↗

Over 750 hours of free live and on-demand learning content for all levels of experience!

rich adder
hearty trout
quick edge
#

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)

green island
#

i need someway to have like a update function that i can put into every script and on one script call them all

quick edge
#

!code

eternal falconBOT
green island
quick edge
# rich adder show what you tried

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

eternal falconBOT
wintry quarry
rich adder
quick edge
#

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 !

wintry quarry
#

well the real code could certainly have a problem

#

this is missing a lot of context

quick edge
#

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

queen adder
#

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:

  1. What does transform.position do?

  2. What do the different types of vectors (like vector3)?

I’ll come back if I have more questions

quick edge
#

Thanks !

quartz grove
#

Hello

wintry quarry
quartz grove
#

Should i learn c# with Unity or learn c# first without unity lib

wintry quarry
queen adder
wintry quarry
rich adder
queen adder
wintry quarry
#

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

cosmic dagger
scarlet skiff
queen adder
#

Also should I be using tutorials?

rich adder
queen adder
#

Cause I’ve heard people say they don’t help

cosmic dagger
scarlet skiff
#

but i got this one now

#

which is similiar

#

i think

rich adder
quartz grove
#

Guys what this guy talking about the awful changes

cosmic dagger
wintry quarry
rich adder
queen adder
#

Watching Tutorials for specific things

#

Like idk how to code 2d movement should I copy paste someone’s code?

rich adder
quartz grove
rich adder
#

but everyone is different

#

try out yourself, they're all just tools for the same job

quartz grove
rich adder
#

its subjective to some extent

quartz grove
#

They say that godot gives free themes

scarlet skiff
quartz grove
#

and whats that : )

rich adder
quartz grove
languid spire
quartz grove
cosmic dagger
#

just pick an engine and run with it. this is not smth you should worry about if you're just learning . . .

quartz grove
#

its something can use on game dev ?

summer stump
quartz grove
#

or just the engine style