#💻┃code-beginner

1 messages · Page 727 of 1

rocky canyon
languid pagoda
rocky canyon
lilac wave
#

Yoo, can someone help me with my game? Thread name: "I really need help with a game im making" I have the whole message of what I need help with waiting for you to read there Pls at anytime help me

slender nymph
#

once again 👇

radiant voidBOT
#

:loudspeaker: Collaborating and Job Posting

We do not accept job or collab posts on Discord.
Please, use Discussions to promote yourself as job-seeking, advertise commercial job offers, or look for non-commercial projects to participate in:
• ** Collaboration & Jobs**

lilac wave
#

Wait me?

slender nymph
#

and just for extra measure i've put that in the thread so hopefully you'll stop spamming this nonsense

lilac wave
#

Bro what

#

I just wanted help, not tryna get jobs or collab just need help..

slender nymph
#

you want someone to do the work for you, yes? that's literally collaboration

lilac wave
#

This discord server be sucking X1000

#

No I need help with the coding not making it

rocky canyon
#

this is channel to help with specific questions..
if you have a "i have this problem"
anyone know the solution..

languid pagoda
lilac wave
#

Then I said really what I needed help with

rocky canyon
lilac wave
#

Help solving, what did I do to you guys?

rocky canyon
#

ya, u basically said.. u dont know what ur doing.. how are we supposed to "answer" that?

languid pagoda
#

ok what issue are you trying to solve with your code

rocky canyon
#

if u ask a question we'll be happy to help you

lilac wave
#

The AI is raycast to detect if a wall is there works but doesn't reset the game

#

(catch the player)

rocky canyon
#

so you need help resetting the game?

languid pagoda
#

so if i understand your raycast is hitting walls but going through players?

rocky canyon
#

you just need the raycast detection to "reload" the first scene then

lilac wave
#

Wait let me draw smt I'll be back

rocky canyon
#

that would help

slender nymph
#

showing code would also help

#

see #🌱┃start-here for what to include when actually asking for help and not just asking people to do the work for you

rocky canyon
#

we're not assholes.. we just need good questions to know how to answer them

lilac wave
#

On the left the gaurd can see you, on the right he cant (wall is in the way) also don't mind the terrible illustration I wrote that on a photo with my finger

rocky canyon
lilac wave
#

Top ones are gaurds and bottom ones are players, I just need help with the script to make the raycast work,-

#

It's a 2D game btw

rocky canyon
#

same stuff applies..
except you use Raycast2D instead of Raycast

rocky canyon
#

and you use transform.right or transform.up instead of transform.forward as u would in 3d

#

right is the X (blue) axis
up is the Y (red) axis

edit: and don't go around telling people your age. especially since ur breaking Discords TOS

lilac wave
rocky canyon
#

maybe this might be something useful to you its 2D as well

lilac wave
#

What time will you guys be on torrrow?

rocky canyon
lilac wave
rocky canyon
#

bedtime 👋 lol

lilac wave
rocky canyon
#

good luck tomorrow 🍀 see ya around if im on

pulsar trail
#

hi guys
I am using Firebase Auth for login and Firebase Realtime Database for saving data
My app has no problem working in Unity test mode
but after building it into an apk and run it on my Android phone,
Firebase Auth is still working but RTDB isn't (i.e. it is neither reading nor writing data to RTDB)

any ideas why it is happening? i have re-downloaded google-services.json into \Assets but itz still not working

wintry quarry
#

Use the Android Logcat plugin in Unity to read the logs

pulsar trail
chilly vigil
#

what does serlize base do

frosty hound
#

Where did you see "serlize base"?

rough sluice
#

Currently these codes updates player camera look when the player rigidbody rotates because player camera is children of player rigidbody, So how can I make these codes to don't change camera look when player rotates?:

//In FixedUpdate():
if(characterMovement != Vector2.zero)
{
    Vector3 camForward = Camera.main.transform.forward;
    Vector3 camRight = Camera.main.transform.right;
    camForward.y = 0f;
    camRight.y = 0f;
    camForward.Normalize();
    camRight.Normalize();
    Vector3 moveDir = camForward * characterMovement.y + camRight * characterMovement.x;
    character.MovePosition(character.position + moveDir * characterMovementSpeed * Time.deltaTime);
    if(moveDir != Vector3.zero)
    {
        Quaternion targetRotation = Quaternion.LookRotation(moveDir);
        character.MoveRotation(Quaternion.Slerp(character.rotation, targetRotation, 0.15f));
    }
    characterAnims.SetBool("isWalking", true);
}
else
{
    characterAnims.SetBool("isWalking", false);
}
timber tide
subtle scarab
#

I have a problem with gravity
I'm not sure what is causing this issue. but I was hoping someone who knows what's going on can help.

I'm learning about gravity and trying to learn from this tutorial exact time code too: https://youtu.be/h2r3_KjChf4?si=IfH0rKkQb3HbdW3R&t=579

But my gravity is pretty messed up. I am not getting the same results at all.
Any idea?
I want my players jump and gravity to reflect that of earths but it's launching my player instead.

A breakdown and explanation of how to jump in Unity3D! Learn to jump like Mario! Implement jumping using c#, the built-in character controller and Unity's New Input System!

This beginner-friendly tutorial is a COMPLETE walkthrough of how to use Unity 3D's built-in character controller to get a character jumping while incorporating animations! I...

▶ Play video
naive pawn
#

!code

radiant voidBOT
naive pawn
#

specifically the part about large code blocks

#

CharacterController.Move should only be called once per frame, that might be a cause of some issues

plush zealot
keen dew
#

If the variables are null then loadPage hasn't been called or it has been called on the wrong object

plush zealot
#

that's what I thought aswell but it's assigning the Sprite correctly which is done the same time as element should be set (talking about the second script)

#

that's what's confusing me :/

#

load Page is being called as an object with this script is created.

keen dew
#

Then onClick is called on the wrong object

plush zealot
#

oh could it be, that it tries to call the onClick function from an empty prefab instead of it's own gameobject created from the prefab?

#

and that's how it calls on the wrong object?

keen dew
#

If you've assigned the prefab to the button then yes, it calls the function on the prefab

plush zealot
#

aaah ok thanks

#

yeah I checked and the onclick function is empty on the created object

#

ty

plush zealot
#

stupid quesiton but can't find what this Component is called, tried "TextMeshPro" but that's just returning a nullpointer error :x

keen dew
#

TMP_Text

plush zealot
#

my goat Prayge

grand snow
#

TextMeshProUGUI is what this one is specifically but TMP_Text covers this too

#

why the name is so different to the display name i dont know

plush zealot
#

yeah that confused me aswell, found people online saying it's just TextMeshPro too. very confusing

hexed terrace
#

TMP_Text is the base class
TextMeshProUGUI and TextMeshPro (if that's right?) extend from the base class, UGUI is for UI, the other is for the 3d component that doesn't require a canvas

nimble apex
#

wait u can use

if(!field of a component)``` to check null?
grand snow
#

things that derive from UnityEngine.Object have this comparison yea

naive pawn
#

well, if said field is an Object yeah (perhaps you meant "field of type component"?)

slender quiver
#
if (tracerLineMaterial == null)
  tracerLineMaterial = Resources.Load("Assets/Materials/TurretTracerLine", typeof(Material)) as Material;  

would this be the right way to assign a material in code?

grand snow
#

yes but you should prefer the generic version of Resources.Load

#

Resources.Load<Material>("Assets/Materials/TurretTracerLine");

slender quiver
#

okay Resources.Load<Material>?

#

ah thx

grand snow
#

you can also use a serialized var for the material or something else like addressables or asset bundles

slender quiver
#

that is a subject i have not covered yet, to be honest

grand snow
#

Well you can do

[SerializeField]
Material mat;

and drag in the asset

slender quiver
#

I was going to ask though, whats the easiest way to disable the visbility of something like a LineRenderer? Id rather not destroy/recreate them over and over, but i have not investigated yet if there is a .visible property or anything

#

okay i understand serialization

#

i was referring to addressables/asset bundles, i guess

grand snow
#

disable the gameobject or just the line renderer component

grand snow
slender quiver
#

ill look into them - id put it on my list yesterday, actually, as i ran into them while reading about something else, but havent yet gone to look into them

#

to disable an object, its .SetActive(false), right?

plush zealot
#

tried this in multiple different ways, but all of them crash unity? Any Idea why this could be? Shouldn't this be a simple thing?

slender nymph
#

disabling a child does not reduce the childcount so that's just infinite recursion as long as the object has any children

plush zealot
#

right that makes sense, ive tried with destroy gameobject

#

and that also crashed it :/

slender nymph
#

just use a regular for loop instead of recursion if you just want to set all of its children as inactive

naive pawn
#

Destroy doesn't immediately destroy stuff, it queues stuff for deletion next frame

#

(at the start of next frame or at the end of this frame, not sure)

slender nymph
#

should be the end of the current frame

naive pawn
#

but yeah just use normal looping

plush zealot
#

how would I implement it then? just clicking on the object to remove it from the deck works, but calling that on click method in the child breaks unity :x

plush zealot
slender nymph
plush zealot
#

ok one second

naive pawn
#
public void ResetDeck() {
  foreach (var child in contentHolder.transform) {
    child.gameObject.SetActive(false);
  }
}
#

this has a tail call. it can trivially be turned into an iterative form

plush zealot
naive pawn
#

yeah that has the issue of Destroy not being immediate

slender nymph
#

the while loop would never end because the condition never changes within the loop

naive pawn
#

you're just overcomplicating it

naive pawn
warm forge
#

why is it important for you @plush zealot to know which book it is?

#

it is a book so cant you than just ge tthe book.GetComponent<EBook>().availablepages++

plush zealot
plush zealot
#

or can I just add render next frame or something?

naive pawn
warm forge
#

what about DRY (dont repeat yourself)?

plush zealot
naive pawn
# plush zealot

btw the magic strings here should probably be replaced by an enum

#

and you could use a dictionary for the indexing instead of the switch..case

plush zealot
#

noted, ty

warm forge
#

it means when your code is repeating itself multiple times you probably could do it smarter

#

when you repeat yourself your just making it more complexer

#

what type is lightning book?

#

or the book types?

plush zealot
#

its an EBooks class

warm forge
#

so you getting from a ebook class a ebook component?

#

you dont have to do that

plush zealot
#

no there's a gameobject called fire book that has a EBooks script on it

warm forge
#

alright

#

so what you can do emily

#

when you have a gameobject array or list

#

you can just loop through the code like this

naive pawn
slender nymph
#

ideally the type would be the component you want to use rather than just GameObject so you can skip the redundant GetComponent call

warm forge
#
if(element != null)
{
  foreach(Ebook g in book
  { 
     if(element == g.availableElementPages)
     {
       g.availablePage++;
     }
  }
}
plush zealot
#

oki ty

#

for clarification on the crashing thing, since it might come up with other things again

#

how would I add a buffer?

slender nymph
#

you were causing freezes (not crashes) because you were looping/recursing infinitely

#

the way to prevent that is to ensure you are not doing anything that would result in an infinite loop or infinite recursion. (with the one exception being an infinite loop with a yield such as in a coroutine or an async method)

twilit jolt
#

hi all, this is actually making me go crazy so i thought i'd ask here if someone knows whats happening
i'm working on a game for a jam, and everything was going well so far (today is the submission date); but just as i was finishing my final pass, the level start screen broke for no reason

this is the only code that changes that specific text:

nightStartText.text = $"NIGHT {nightData.selectedNight + 1}";
Debug.Log($"Starting night {nightData.selectedNight + 1}");

and the nightDatas selected night shows up correctly (it's 1 behind, since it's the ID i use to sample from an array that has the level dififculty settings)

sage mirage
#

Hello, guys! I have an issue. I really cant understand why in play mode when I am pausing the game everything stops working as expected but on built mode when I pause the game some audio sources are working. Is there a logic explanation to this kind of issue?

#

The issue is actually with audio sources I have one two audio sources

slender nymph
twilit jolt
slender nymph
#

change your log to this: Debug.Log($"Starting night {nightData.selectedNight + 1}", nightStartText);
then when you click the log it will highlight the object that you are setting the text on to make sure it is the correct one in the scene

twilit jolt
#

it says the content is correct, but it still displays 0
what's stranger, is i changed the base content to gibberish, so it's actually updating to say 0

slender nymph
#

and when you click on the log, it's highlighting the correct text object that is in the hierarchy and not perhaps in the project folder?

twilit jolt
#

yup, it jumps to the correct one

slender nymph
#

then something else is assigning to its text property

twilit jolt
#

that's what i thought at first too, but i checked all my scripts, and the only one that sets this text, is the game manager script, and it only does it once in the start method

grand snow
#

its not going to show something you dont tell it to show

slender nymph
#

find all of the references to that object using the context menu option to make sure that is actually the case

grand snow
#

Id put a breakpoint where you assign the new text string so you can see what its actually doing
(using a debugger)

twilit jolt
#

okay.. so i might be dumb 😭
somehow i accidentally duplicated my canvas (no idea how i did that without noticing lol), and the base animation was the night start one, and the new one overrid the old canvas, and the new one wasn't set, so it just stayed at 0
i am so sorry for wasting ur guys time, but tysm for the help :)

plush zealot
#

what's the name of this component in script? Trying to use 'Button' tells me there's multiple different Buttons but also doesn't let me specify one. I want to search for a Button component and run it's onClick(); method

plush zealot
#

it tells me that that class name is not valid at that point?

slender nymph
#

what exactly does it say

plush zealot
#

"class name is not valid at this point"

slender nymph
#

then you've done something horribly wrong. without seeing your actual code we can really only guess at what you've done 🤷‍♂️

plush zealot
#

used the wrong brackets, sry. ty for the name help though was needed still

soft knoll
#

Hlo

#

Anyone here

#

There is something wrong man Idk why my animation stops at 1st frame only whenever I switch back to home scene from any scene and click one button to play a animation that animation 1st frame is only played idk why can anyone help

hexed terrace
soft knoll
#

Ok

dull grail
#

Why game object make this rapid, almost teleporting jump in 1st few moments? I've tried to use either force and impulse modes

public class TestRam : MonoBehaviour
    {
        // variables

        ...

        private void Ram()
        {
            Debug.LogWarning("Reminder: targeted player is hardcoded");
            var direction = Mathf.Sign(player.transform.position.x - _rb.position.x);
            var force = new Vector2(ramPower.x * direction, ramPower.y);
            _rb.AddForce(force, ForceMode2D.Impulse);
        }
    }
twilit mica
#

Hey anyone on

#

How do you know when to use rb.linearvelocity

slender nymph
#

You'll know to use it when you want to set the velocity directly

keen dew
dull grail
#

Will try, thank you

#

Yeah, now it work as intended, thank you again

broken bloom
#

hi, apologies if i need to get more code or other screenshots please just say if you need more, but is something wrong with my line of code here (the second image)? No matter if I'm actually standing on the ground or not, the code never says i'm grounded (and I have made sure the floor is assigned the ground layer)

#

i only started unity a couple days ago so i'm still not sure how this all works, but i looked up raycasting and cant see exactly what ive done wrong

slender nymph
zenith cypress
#

raycast is out var hit, DISTANCE, mask

broken bloom
#

oh so i'd need a number to say how far the raycast goes before stopping?

#

sorry i haven't had time to troubleshoot since i've been doing stuff but these both help so thanks

opaque plume
#

Hi, I don’t know where is best to ask but I made a mod in Unity to replace a character model in a game. I have added physics to the characters skirt but it clips through the legs.

Is someone able to help or point me to something that can help? Like adding collision?

Note: I am a beginner haha

slender nymph
#

modding discussions are not permitted here #📖┃code-of-conduct
you'll have to ask for help in the game's modding community

opaque plume
#

Ok thanks!

open apex
#

The y variable is public. At first it the error didn't make sense until I had a look at potential fixes. It's telling me that this data should be within the class. But I want the LINQ to sort certain variable (this will be determined based on user input), so I have tried to determine that with a string but it doesn't work and I don't want to a shit ton of if methods just to make it work

#

Is there any way I can make it so the LINQ woulda accept my string

#

otherwise I would have to hard code it or go through new brain rotting programming that I haven't learned yet

open apex
slender nymph
#

It's telling me that this data should be within the class
what do you mean by this

open apex
#

custom class

polar acorn
open apex
#

it requires a variable y

slender nymph
polar acorn
# open apex no

Then why are you trying to get the y value of each element in items if it doesn't have one

slender nymph
#

but if your Item class does not have a y property/field and your code that is trying to access that property is not underlined in red then you need to get your IDE configured 👇

#

!ide

radiant voidBOT
polar acorn
open apex
#

no I understand that this is the problem already

#

I am shit at explaining

#

what I am trying to do is determine which variable to be sorted with y variable

#

but it does not accept that

naive pawn
#

so you want y to act as an index

polar acorn
#

Why have a y variable at all

naive pawn
#

that's not really how props work in c#

polar acorn
#

just do the sorting inside the case statement

#

Create the sortedData variable before the switch, and in each case do a different sort

open apex
#

There is this thing SortedBindingList I haven't gotten into

naive pawn
#

get something that works before making it good

polar acorn
slender nymph
#

i mean technically they could do something incredibly cursed like add an indexer to the class that accepts a string and switches on that or whatever, but of course that indexer would need to return object since none of the data types are the same. but attempting to do this is insane and 100% an xyproblem

open apex
#

and that would actually sort out my problem but right now I find it too complex to go into rn

polar acorn
#

In this case, the "clever" solution actually runs significantly worse

#

it's less expandable, but are you actually going to need to expand this?

polar acorn
open apex
#

This is the end of this part of the code

open apex
#

if I did I would have to update this

#

I know

polar acorn
#

The only benefit to trying to do reflection here is that new properties wouldn't need to be added to this function, and it comes at the cost of making the function take about five times as long

open apex
#

such as learning how to use datagridview list took me a bit

polar acorn
#

Never skip steps

random lodge
#

Step 4. Release as early access and do #2 and #3 later. 😉

#

jk

abstract vapor
#

I have set Unity to use Visual Studio in external tools, now when I double click a script in Unity, it opens up a blank window Visual Studio

I have tried the following:
Reinstalling Unity and Visual Studio
Set both Unity Hub and Unity as Run as Adminstrator

Scripts open normally in Visual Studio if right clicked -> Open with Visual Studio in Windows File Explorer

frail hawk
#

i think you have to reset the vs layout

abstract vapor
analog pendant
#

How to build a most simplest tpp in unity

polar acorn
#

Trans-Pacific Partnership?

rich adder
keen dew
#

Thermal Power Plant

naive pawn
#

toilet paper premium

polar acorn
#

Twitch Plays Pokemon

rich adder
#

The Poop Peddler

low copper
#

I'm trying to setup a scene manager by following a tutorial. Using the their code...for me the scene instantly gets added to scene. What I was hoping for it not to get added yet. For it to simply be add put into a list so I can loop through the list and add it later. Can someone explain why it is running immediately?

#
List<AsyncOperation> scenesActionList = new List<AsyncOperation>();
scenesActionList.Add(SceneManager.LoadSceneAsync(sceneIndex, LoadSceneMode.Additive));
grand snow
#

you already started the operation

#

async things begin once you call the function

#

you can add the task to a list to await later but the work is still running (or may have finished)

#

Dont want to start it yet? Then dont call it yet...

low copper
#

So adding to a list is synomous to calling the function. I thought it was storing the code so I can call it at future time?

#

The guys video seems to work as expected

ivory bobcat
slender nymph
#

Yeah you'd want a list of delegates

grand snow
low copper
#

ah ok...that makes sense

grand snow
#

as said, you can instead keep a delegate ref in a list which you can then invoke later:

List<Action> actions = new();
actions.Add(() => SceneManager.LoadSceneAsync(sceneIndex, LoadSceneMode.Additive));
#

Action is a premade delegate type

low copper
#

Perfect. That makes a lot of sense. Thanks for explaining.

twilit carbon
#

hello all, extremely nb doubt incoming.. I'm trying to finish the Roll-a-ball tutorial, but even doing ctrl-c ctrl-v in the suggested code I can't give commands for my ball to move (I confirmed gravity and it's working fine - I tested getting the ball with a positive vertical value and it falls down just fine). Maybe it's some of my player or my ground's component settings ?

#

when the ball touches the ground, it just freezes and inputs do nothing to it

twilit carbon
#

nevermind, I just discovered the reason to it 😄

earnest wind
#
if (!Directory.Exists(levelDataPath)) Directory.CreateDirectory(levelDataPath);

Is it necessary to check?

#

i mean, why is even Photon doing it? weird

#

pretty sure it should check internally and wont override

rich adder
#

CreateDirectory already checks

#

not a code question

earnest wind
#

ah wait im dumb, photon checks for it to do the import asset

#

ups my bad

#

not here

#

people ask for help here, not share videos

#

also share the video there

#

not the channel itself

#

or maybe u can idk

#

also one more question

#

is it useful to cache the length of array?

#
int BuildingGameObjectsLength = BuildingGameObjects.Length;
            foreach (GameObjectData data in allObjects)
            {
                if (data.prefabID < 0 || data.prefabID >= BuildingGameObjectsLength)
#

or does accessing the length not do much of an impact? (Even on 30k objects?)

#

ok i did try and search and it has no problem ig

#

so no need to cache

rich adder
earnest wind
#

and it probably even compiles it to make it even more econom so that shouldnt be my worry

rich adder
earnest wind
#

oh

#

i see

rich adder
#

yea a lot lol

earnest wind
#

im not trying to shred ms tho...

#

the problem is literal seconds xd

ashen girder
#

If i wanted to set an array of game objects to true , do I have to turn them all off by using a foreach function or is there a better way

I'm unexperienced with arrays and I want to enable a bunch of game objects at once

rich adder
#

im just saying..nothing to worry about then lol

earnest wind
rich adder
earnest wind
#

right now it takes like 1 seconds for 5k objects

teal viper
earnest wind
#

the worst performance on it is this piece of code

#
HierarchyItem = Instantiate(hierarchySystemCartCreate.HierarchyChildPrefab, hierarchySystemCartCreate.HierarchyParent).GetComponent<HierarchyItemCartCreate>();
                    HierarchyItem.myGameObjectImReferencingTo = instance;
                    HierarchyItem.eventSystem = eventSystem;
                    HierarchyItem.buildingSelectingDestroyingSystemCartCreate = buildingSelectingDestroyingSystemCartCreate;
                    HierarchyItem.SetUp();
                    hierarchySystemCartCreate.ActivePlacedObjects.Add(instance);
                    hierarchySystemCartCreate.HierarchyItems.Add(HierarchyItem);
ashen girder
earnest wind
#

im making my own hierarchy system

rich adder
teal viper
ashen girder
marble crown
#

Hi guys, Im very new to Unity and have a general quick question:

Are the variables shown here inside the unity engine? Because when I begin to type them, I can let it auto complete by Visual Studio?

earnest wind
ashen girder
rich adder
earnest wind
#

ok my unity crashed because of profiler

#

😭

teal viper
marble crown
polar acorn
earnest wind
rich adder
polar acorn
teal viper
rich adder
#

the rest are value types, they do not have functions they are just numbers

earnest wind
rich adder
#

you wont know for sure if you don't profile lol

teal viper
marble crown
ashen girder
#

Alright thanks everyone this was basic indeed

polar acorn
radiant voidBOT
earnest wind
#

instantiation of UI is bad, and its because its paired with scroll view + layout + content size fitter

earnest wind
#

hierarchy item

marble crown
earnest wind
#

the thing im instantiating

teal viper
# earnest wind its because it is UI tho right?

Instantiating can be heavy regardless of whether it's ui or not. The good thing about ui is that you can have it all in the scene from the start and avoid instantiating it. Or use some kind of pooling system of needed.

rich adder
earnest wind
#

yeah its like doubling it

#

because im already instantiating for gameobject, but then im also instantiating for hierarchy

teal viper
earnest wind
rich adder
#

"the hood of my car is smoking... its probably just the tires"

earnest wind
#

exactly xd

rich adder
earnest wind
ivory bobcat
#

It's got to be elsewhere...

earnest wind
#

with it disabled i dont feel it

#

i mean hear it

earnest wind
rich adder
earnest wind
rich adder
#

have you confirmed with real numbers

earnest wind
#

i can redo it 100 times and it will make sound when that line is enabled

ivory bobcat
earnest wind
#

when its not its not doing it

ivory bobcat
#

Hopefully not entire canvas' and whatnot

earnest wind
#

thats the prefab

#

btw

teal viper
earnest wind
#

i made the screetching quieter by doing this

EditNameInput.SetTextWithoutNotify(Name);

earnest wind
ivory bobcat
#

Ah.. are you perhaps changing the text of millions of items?

earnest wind
earnest wind
#

no actually 5k

cosmic dagger
#

Do you have thousands of items?

earnest wind
#

Yes

cosmic dagger
#

and this all happens at once?

earnest wind
#

Yes

#

Has to

ivory bobcat
#

If the canvas has got to update for every change (it's dirty), you may see some heavy delay

cosmic dagger
#

Why are you changing the name of thousands of ui at once?

earnest wind
earnest wind
#

its a hierarchy system

#

i know it looks bad

#

its placeholder UI

ivory bobcat
#

Could probably reduce scene rendering expenses by setting the objects inactive (maybe the entire canvas) then activate again after you've finished modifying every element. There's a one time cost though. Not sure if it's useful though if you're already processing all this in a single frame.

teal viper
earnest wind
earnest wind
teal viper
earnest wind
#

wait

#

i forgot to open it

#

sorry

earnest wind
#

i dont have enough time left today, thanks for helping, you can still reply, i will check replies tomorrow, bye

teal viper
teal viper
vocal orchid
#

How I can find objects inactive?

cosmic dagger
#

and make sure to set the parameter correctly . . .

wintry quarry
cosmic dagger
#

Collections are your best friend . . .

zenith wren
#

really weird issue I'm having, where I pickup an object which is not colliding with the player in any form somehow launches the player into the stratosphere

rich adder
#

if you dont need vase to collide with player on pickup just turn off collisions between the two

#

this script needs a lot of improvement, especially GetGameReferences()

#

why have [SerializeField] if you don't assign in inspector

zenith wren
#

I just like seeing them get all filled in

rich adder
#

those functions are really slow..

#

also a bit strange to have all this code on pickupable item instead of doing it with a pickup script on player

zenith wren
#

I tried having it in the player but for some reason the dropping part would activate as soon as it was picked up

rich adder
#

should not be happening. especially waiting a keypress

zenith wren
#

maybe I used GetKeyUp without realising

rich adder
#

this is using rn the new input system sounds like you had something else before

zenith wren
#

oh woops yeah I am, nvm I just had a brain fart

rich adder
#

transform.position = followTarget.transform.position;
transform.rotation = followTarget.transform.rotation;

#

usually you want to use the rigidbody component directly if it has one, transform creates weird issues with rbs

zenith wren
#

ah I see

rich adder
#

but yea turning off collision betwen player and picked up item should help cc not bug out

zenith wren
#

gotcha

mystic flume
#

what appen

rich adder
mystic flume
#

uh yeah

#

umm how do you make cooldowns

rich adder
mystic flume
#

Yeah but how do you make the timer?

rich adder
mystic flume
#

Ok thank you

queen adder
#

Hey guys, I'm new to Unity but I'm a little overwhelmed about C sharp and I don't have much of a programming background. Is there anything you would recommend to help me get started?

rich adder
queen adder
rich adder
queen adder
cosmic dagger
queen adder
#

You know like maybe fall tutorial but then try to understand the code from there?

cosmic dagger
queen adder
#

I've mainly used game maker and I know it's not as complex as Unity but I found that when I just go in fall tutorial even go back and try to debug and finally get it. That's when I'm most productive

#

It may not be the optimal way or the most efficient, but it sure as hell beats getting stuck in paralysis

#

And yet a lot of people tell me learn the basics. First. Go through courses and all that crap

#

I'm going to dilemma and I don't know what to do

#

On one hand, if I try forcing myself to learn the basics and somehow succeed despite my crippling ADHD, I might be able to have a better understanding of bugs to squash in the future and having to follow less tutorials

#

On the other hand, if I go in using my current plan of just just following tutorials and try on, I may get hung up but at least I'll feel less overwhelmed from the start and gain more momentum

#

So yeah

cosmic dagger
queen adder
#

Thing is once I get momentum I usually have to discipline to see through a bug to fix even if it means starting without feeling like I know everything about C sharp

cosmic dagger
#

Though I'm unsure what you mean by "fall tutorial" . . .

queen adder
# cosmic dagger Though I'm unsure what you mean by "fall tutorial" . . .

I don't know. Maybe that was a typo. The point is just about every course that introduces a new programming language or even if I go on coding dojo or whatever. I burn out pretty fast cuz it's hard for me to concentrate and all I can think about is if there's a better way to do it this and just bring my vision to life

#

I guess I should just force myself again to learn the basics and hope eventually it sticks

#

I have to keep putting my passion project on hold so who cares anyway

#

Even though it makes me happy in the moment

cosmic dagger
#

I was originally an artist. I used Unity because it seemed easy to get started. I learned C# and Unity at the same time, so it is doable, but I do think it's important to learn the basics . . .

queen adder
#

I'm probably overthinking it

cosmic dagger
#

It helps greatly when debugging and to understand the tutorials . . .

queen adder
cosmic dagger
rich adder
#

learned c# cause of unity . its not difficult to learn both

cosmic dagger
# queen adder Well everyone I talk to seems to say otherwise

It's fine to do, but often times, most people have trouble because they skip the fundamentals of C# and jump in to random tutorials on how to build a specific mechanic/system. This leaves them with limited knowledge and no idea for how to expand or connect it to anything in their game. Not to mention, debugging or fixing an error because of a lack of syntax or the difference between a reference and a value type . . .

cosmic dagger
queen adder
#

Like every time I've tried in the past I get a little far and I jot it down and then I think wow this is boring. I just want to go back to my game

#

Pomodora method helps a little bit I guess

#

I guess I'll try maybe like one video a day of the course I don't know

analog pendant
rare bone
queen adder
rare bone
#

What's the benefits

teal viper
# queen adder All right I just hate having to force myself to some of some. Some old geez are ...

No one likes sitting and learning properly. It takes effort. It's the same for everyone.
You either force yourself to do it, or learn as you go, but you need to be prepared to constant googling of docs and tutorials if you do it, that will distract you from whatever you're trying to do.
There's no easy way. Learning a new skill is hard. You either go through it, or give up.
The structural learning path is hard at first but easy in the long run.
Learning as you go(including basics) is gonna be hard in the long run and is more likely to make you give up.

analog pendant
#

I kind of forgotten c#, I'm learning while making things

rich adder
#

unless you are making something super simple

analog pendant
#

I started on 2021, but had to leave it cause of the studies, now finished the school, and learning again

analog pendant
#

So, I can make it simple

#

With code

#

And then add complex layers on top of it

#

I'm a programmer, but unity c# functions are confusing for me

rich adder
#

there isn't any special unity c# or anything

#

!docs

radiant voidBOT
rich adder
#

anything unity here

analog pendant
#

That's the main issue

teal viper
queen adder
teal viper
# queen adder Well how do I make it less painful? Weed?

This is subjective. Different people prefer different approaches. For me, I was working on my own "dream project" and mostly learned as I go, but I also read through the unity and C# manuals whenever I had free time(like on the train), and investigated engine features and code syntax online whenever I encountered something new. Eventually I understood that what I was doing was very limited and switched gears to a different "challenge" project, the goal of which was to go through the development of a simple game from zero to a release all the way.
Later, I worked as a freelancer on other people's projects and even later in a proper company. All these stages were very valuable experience and learning opportunity.

queen adder
#

I'm probably going to burn out but whatever

#

Trying to think of a reward system I can give myself to encourage me

#

I just hate coding so much man or actually I hate learning to code

#

But I love my passion game more

teal viper
#

Once it clicks, it's actually pretty rewarding.

queen adder
teal viper
#

Even just reading the docs and having that eureka moment.

queen adder
#

How am I supposed to be that patient for a whole year?

teal viper
#

It doesn't have to.

queen adder
#

In this era of instant gratification

queen adder
teal viper
#

Make small goals that you can accomplish fast and you'll get rewarded enough to continue

queen adder
#

I'm really angry. I'm sorry just hate having to accept this

#

Like I'm already angry. Just thinking about it. Just having to deal with this undead zombie prattling at me through a camera

#

When I could be bringing my characters to life albeit imperfectly

teal viper
#

Like writing a hello world console program. Or making a goal of understanding certain api, like dictionaries or something. Or learning the concepts of OOP and applying them to everyday objects.

queen adder
#

I'm sorry I'm just really impatient

teal viper
#

Because a grappling hook is just many of these small things.

queen adder
#

Just feel like I got to get this done as soon as possible so I can hopefully find a job overseas to get out of this horrible country

teal viper
#

Yep. Which is why tutorials are fine. As long as you don't just copy them.

queen adder
teal viper
#

If you learn something new and able to generalize that knowledge to other areas, that's good enough.

queen adder
#

You know tutorial hell and all that

teal viper
#

That's exactly what happens when you just copy tutorials and don't learn from them.

queen adder
#

But yeah, maybe I've copied and pasted a few

teal viper
#

Not just tweak, learn the mindset of solving problems.

queen adder
#

But whatever I'll just have to nut up. I'm just tired. I already know this is going to be hell

queen adder
#

You know like next to the lines

teal viper
#

The fact that you add comments probably means that you don't understand it properly.

queen adder
teal viper
#

It means that you can't just look at the code and say what it does.

queen adder
#

Well sorry for not being a genius like you

teal viper
#

But you should be able too. If you want to improve. Just try it. Instead of taking the code for granted, read through it line by line and ask yourself what that line does.

queen adder
teal viper
gentle bone
teal viper
queen adder
analog pendant
teal viper
tall heart
#

If i make games by following tutorials but learn some lines each time its that good?

hard wind
tall heart
#

Im currently following a youtube series for a small open world game and so far I've learned some things

analog pendant
teal viper
#

I asked for examples of engine concepts that are confusing to you.

languid pagoda
#

Guys I have a weird one. This is my engine script. It simulates an engine for a car. Its currently being ran in a physics substep where it loops 100 times inside fixed update. Code works fine with higher values like 20-100 but if I reduce the substeps down to anything lower the engine begins to output a negative torque.

https://gist.github.com/rybakatya/10b904eb795c52b71066fc3f5ce17715

what am I overlooking?

analog pendant
#

all these things

languid pagoda
#

thats not engine concepts that is just basic development

#

what part of a third person perspective ae you struggling with?

#

ik when I first started i really struggle with camera clipping through walls everyone said use raycasts to fix it coudln't get that to look good it was always to jerky so i used character controller on the camera 😂 then no more wall clipping

teal viper
tranquil forge
#

im messing around with unitask since i've heard it better then coroutine, also trying to save load without freezing the game
am i using this wrong cause this keep saying unitask is the slowest? with the unitask.create somehow better than running the async function? cant find any example usage of this .create so idk
here my test script https://paste.mod.gg/tapzymfyhfxk and the result

midnight plover
tranquil forge
#

private async UniTaskVoid
running this async function is the slowest

midnight plover
#

Ah, did not check your script yet. I guess, using the async void versino of UniTask is basically a lightweight version but still not the same as if you create an actual UniTask thats not bound to the game loop. But thats just an assumption

tranquil forge
#

going through the Unitask.create somehow much faster than running the default async function

tranquil forge
#

can you point me to the specific part

tranquil forge
midnight plover
#

The link did point to the specific text talking about the void version

#

Oh, it did not apparently 😄

#

guess they prevent text links. just search for "UniTaskVoid"

tranquil forge
#

idk i only find it saying unitaskvoid suitable for fire and forget scenario and want to show exception

grand snow
#

This is not "profiling uni task" its seeing how long counting to 500000000 takes

#

what a joke

teal viper
#

Though it's still curious why there's such a difference.

grand snow
#

probably a fluke

#

if you run it once and that's it then it will have random variation anyway

keen dew
#
Stopwatch sw1 = Stopwatch.StartNew();
for (int i = 0; i < 500000000; i++) { }
sw1.Stop();
UnityEngine.Debug.Log($"[i] Finished in {sw1.ElapsedMilliseconds} ms");

Stopwatch sw2 = Stopwatch.StartNew();
for (int j = 0; j < 500000000; j++) { }
sw2.Stop();
UnityEngine.Debug.Log($"[j] Finished in {sw2.ElapsedMilliseconds} ms");

Stopwatch sw3 = Stopwatch.StartNew();
for (int k = 0; k < 500000000; k++) { }
sw3.Stop();
UnityEngine.Debug.Log($"[k] Finished in {sw3.ElapsedMilliseconds} ms");
#

Conclusion: always use k as the for variable name to make it run faster \s

upbeat dirge
#

Which design pattern do you recommend using when organising code? Unfortunately, I don't come from C#, but I have programmed object-oriented with PHP and usually used MVC.

Currently, with C#, I am using MVVM.

I have read the Unity e-book: Level up your code with design patterns and SOLID, but I am a bit confused. Can you clarify which pattern to use?

PS: I am a beginner with Unity.

keen dew
#

Isn't the whole book about that subject?

upbeat dirge
keen dew
#

I haven't read the book but going by the description it should talk about which pattern to use in which situation, and there's even a sample asset with examples. You're supposed to treat them as a toolkit where you pick a suitable pattern for each situation, not choose one and then use that forever and nothing else

celest ore
#

@upbeat dirge Try not to over-engineer or over-design such that the game is never made. Remember, prototype first, if its finalised then create a surface level design architecture you will follow. Never go in the details because details are gonna change mid-dev phase

queen adder
#

Like maybe do an hour tops and then work on my game since that's what I actually want to do?

teal viper
queen adder
queen adder
upbeat dirge
teal viper
tranquil forge
queen adder
#

I just wanna...

teal viper
#

I'm sure people with epilepsy would appreciate that gif...

grand snow
celest ore
#

<@&502884371011731486> Can this gif be deleted? Its causing epilepsy fr

#

Thank you Mods!

north kiln
tranquil forge
#

im still clueless how to measure rn. so rn its safe to assume unitask its better then and i should go with it when i can choose between the 2

grand snow
keen dew
# tranquil forge im still clueless how to measure rn. so rn its safe to assume unitask its better...

The task itself always takes the same amount of time (*) regardless of whether you use async, unitask, coroutine or whatever else. The only difference is the small overhead of starting the task but that's completely negligible in almost all cases. So performance of the overhead shouldn't be a consideration when you're deciding which one to use.
(*) unless you split the task workload or use threads but that's not what was measured here

tranquil forge
#

The watch is right before loop and not outside the unitask Stopwatch sw = Stopwatch.StartNew();

    for (int i = 0; i < 500000000; i++) { }

    sw.Stop();

This is still include the cost of starting the unitask ?

keen dew
#

No, it only measures the loop and nothing else

tranquil forge
#

Whats the overhead you were refering to

keen dew
#

And even if it did measure the task overhead, it would be so small compared to the loop that you couldn't see it in the result

#

UniTask.Create is what makes the task and that's not included in the measurement

#

Imagine if you wanted to measure which is faster, an airplane, a train, or a car. You then fly to Paris, start a stopwatch, run around the Eiffel tower 100 times, stop the stopwatch, and then fly back. Then you take a train to Paris, start a stopwatch, run around the tower, stop the stopwatch, and take a train back, etc. So you're only measuring how fast you can run around Eiffel tower and not the actual thing you wanted to know about

tranquil forge
#

But i run each so many times, in different sessions too and the async always noticeably slower than the coroutine, when in reality they should be the same? So what were the overhead you were refering to

keen dew
#

The overhead is not affecting your measurements. The difference is caused by other things

tranquil forge
keen dew
#

What I'm trying to say is that your measurements are inherently flawed and meaningless

#

The overhead is starting the unitask or coroutine or whatever

tranquil forge
#

But my thing did exclude that out right?

keen dew
#

Yes

teal viper
opaque plume
#

Would anyone be able to dm me to help me with an issue with part of a character model clipping into its self. I guess I need some sort of collider/collision

keen dew
naive pawn
#

is this about modelling, animation, etc? find the channels for that

tranquil forge
#

I see

opaque plume
naive pawn
#

yeah, they aren't

#

soliciting DMs for that topic aren't either

#

ask in a community about modding that game then

opaque plume
#

The discord for modding the game isnt very active which is why I came here. I will look else where for help

naive pawn
#

if no-one there is available for help (for the specific game/issue) then good chance no-one here is too lol

random lodge
#

Hmm how do you get the camera distance from a gameobject? Could be simply the center of the camera view or even a corner. I just need to compare the distance between a gameobject and somewhere inside the camera to destroy it after it's a certain distance out of view.

wintry quarry
#

or do you want the world space distance between the camera and the object

random lodge
#

Not sure, I just need to destroy an object after it leaves the camera so far

wintry quarry
#

sounds like you want screen space or viewport space

random lodge
#

I was trying something like

#

if (Vector2.Distance(transform.position, not sure what I can put here) > 5) { Destroy here };

wintry quarry
#

then you can check if the viewport x/y coordinates are < 0 or > 1

#

which means it's outside the screen

#

Viewport space is normalized and relative to the camera. The bottom-left of the camera is (0,0); the top-right is (1,1). The z position is in world units from the camera.

shell sorrel
#

the viewport space conversion is how i always did it, also used it for hte opposite to trigger things when the player is looking at them as well

random lodge
#

Hmm I'll have to read and try to concentrate and figure this out after the dentist lol

wintry quarry
#

e.g.

Vector2 viewportPos = myCamera.WorldToViewportPoint(someObject.position);
if (viewportPos.x < 0 || viewportPos.y < 0 || viewportPos.x > 1 || viewportPos.y > 1) DoSomething();```
random lodge
#

A start anyway I wasn't exactly sure what to search for

shell sorrel
#

keep in mind you would need to account for the size of object as well

wintry quarry
#

indeed, this is a starting point

shell sorrel
#

since this is using the objects origin point, but that is also simple just use its bounding box to pad those numbers out a little

random lodge
#

I had a bug where the spawner stopped working and I realized oh, I dont allow more than 2 to spawn and they are going off the screen hah 😉

#

Got another to fix after that where they are spawning too far on the edge and I can't shoot them lol. Next I guess.

simple sun
#

do anyone have good recommendation on how to better handle these tiles?
i have about 200 of them in 1 axis, with 6 of them in another axis
i need them to fall when the player touches them so i want them small
but having so many tiles is really eating the performance
how can i better handle them?
just them existing without anything actively updating with them, eats on my performance

shell sorrel
#

is 1200 objects really eating perf that much?

#

would figure out what part is the problem logic on them, physics or rendering with the profiler

simple sun
#

ive got nearly nothing else in this scene

simple sun
shell sorrel
#

are a few ways to approach the problem, but how to do so really depends on what the problem is

queen adder
shell sorrel
simple sun
queen adder
#

Even if it takes longer and is more frustrating?

shell sorrel
shell sorrel
#

but what myself and others are saying is just watching stuff or reading alone will not be enough you have to apply it and test your understanding to truely learning it

queen adder
#

It's like I got to learn to crawl before I walk

#

And given my penchant for anger, I'm afraid I might even get so angry. I'll break my computer

shell sorrel
queen adder
shell sorrel
#

also as you learn what is required to get different things done, you apply it to your game

queen adder
simple sun
#

well yeah its due to the amount, but

queen adder
#

I mean I can force myself but it'll take more mental energy and probably burn me out faster

#

And I don't know what C sharp course to start with

#

It's all a bunch of bullshit anyway

queen adder
naive pawn
#

there are beginner resources pinned in this channel

shell sorrel
queen adder
#

Great

naive pawn
#

it is important to remember, you have to walk before you run. it's normal to feel like you aren't doing much while learning to walk, but if you skip to running you'll end up tripping

shell sorrel
#

i learned as a kid when i only had dial up internet and had to get most infromation from manuals and books

wintry quarry
naive pawn
shell sorrel
#

you just have to accept its a process and you will need to learn some things

queen adder
#

Ultimately, I know you're right

#

Curbing passion is just part of being human

#

Just hope I don't have to put it off for too long

shell sorrel
#

its not curbing passion though

naive pawn
#

not at all

queen adder
naive pawn
#

this is setting yourself up to be able to actually go through with passion

queen adder
naive pawn
#

that could be it, maybe

#

one sec

shell sorrel
#

you break things down to small steps, and you learn what is requried to complete each of those steps

queen adder
#

Yeah looks like I'm in the shit now

#

So on average how long would you say it usually takes to get proficient at C sharp before I'm ready to feel confident in unity?

queen adder
#

But yeah I got it

shell sorrel
#

depends on the person, but few weeks should be enough to do basic things

naive pawn
#

no matter what, you're going to have to figure out the "logic" aspect if you want to have stuff flow and interact
and to use unity or whatever engine, you'll have to learn the "library" aspect
since unity uses c#, you'll have to learn the "language" aspect there

split it up into parts to make it less daunting

queen adder
naive pawn
#

draw out your logic in a notepad or something, learn c# and unity separately, for example

shell sorrel
#

like its really no different then learning any other skill, its not like you can do amazing stuff so early into learning to play a instruement either

queen adder
queen adder
naive pawn
naive pawn
queen adder
#

Adhd doesn't help either, although I'm sure I'm not the only one here with it

#

Whatever, I'll just do it

#

I'll probably get burnt out and pissed off and grumpy. But yeah, whatever

willow pine
#

ughhh can anyone help me please? my deadline is literally in 2 hours and im stuck

#

so, after my character jumps, he freezes, no idea why

queen adder
#

That's what it's there for

willow pine
queen adder
willow pine
#

using the latest one

queen adder
naive pawn
willow pine
#

he doesnt know how to solve this, so im not sure if i fucked something up in unity

willow pine
naive pawn
queen adder
queen adder
wintry quarry
queen adder
#

He can go back and analyze the code later

naive pawn
naive pawn
radiant voidBOT
queen adder
wintry quarry
wintry quarry
willow pine
#

yea

naive pawn
#

im just not gonna entertain the remark of using AI here at all tbh. it's consensus that it's not a magical solution and it's not really accepted in any support community

wintry quarry
queen adder
naive pawn
#

cool, no need to force that on anyone else

queen adder
#

Some people just want the fastest solution even if it's not ideal because hey, at least you're not beating your brain's out

naive pawn
#

the consensus is clear here

queen adder
naive pawn
#

im not entertaining this discussion. we have a containment thread if you want to check the echo chamber of genAI's virtues

naive pawn
queen adder
naive pawn
#

lmao no

queen adder
#

It's just a means to an end

naive pawn
#

coding is really fun for me, actually

queen adder
naive pawn
#

well that's true but unrelated

queen adder
naive pawn
#

why do people engineer robots when we can just do labor ourselves smh

#

this is such a dumb discussion LMAO

queen adder
#

I'm just trying to mentally prepare myself to go through this hell

naive pawn
#

why do people enjoy crocheting when sewing machines exist

queen adder
#

Cuz it seems every time I've forced myself to learn a language in the past I crash and burn out

#

And I really don't know how I'm going to change it this time through sheer self-discipline when my heart says just do what you want to do

shell sorrel
#

if everyone hated it i would not not gotten into games, and made a career on software development and do electrical engineering as a hobby

queen adder
#

If I absolutely hated coding, I want to get any progress done at all

naive pawn
queen adder
naive pawn
#

i already said you don't have to code just to make something

queen adder
#

I think a key difference here is most people here. Start getting into Game Dev with a love for either programming or making games themselves. Whereas the whole reason I started is cuz I got so passionate about my story and lore that I just wanted to bring them to life in the way I best see fit. So then I just went through the motions of learning what I had to do as it came up

naive pawn
#

the suggestions here were for tackling it, under the assumption that you wanted to

#

but if you don't want to, then just.. don't

queen adder
#

Nobody wants to pay taxes but you have to unless you want to go to jail

naive pawn
#

no-one's forcing you to code

queen adder
naive pawn
#

no, not at all

queen adder
#

And potential employers

queen adder
naive pawn
#

you already said you don't like coding. why would you get a job that involves coding

queen adder
#

I guess it's just because I am passionate about games and bringing them to life but not the process itself

#

I'm more interested in the art and creativity and writing of it all

shell sorrel
#

what you want is narrative and game design, it does not require programming

naive pawn
shell sorrel
#

but also very very few jobs in it

#

since everyone has ideas

queen adder
naive pawn
#

also, have you tried visual scripting (or its analogs) that try to make it easier for beginners?

queen adder
naive pawn
#

the only AI threat is managers who don't know shit thinking it can replace actual brains

#

it's not actually going to replace real output

shell sorrel
#

my old job is trying to contract me to fix shit made with AI, the jobs are not going anywhere

queen adder
#

And even if it doesn't, I can usually go back and tweak it and see what it did wrong

shell sorrel
#

the downturn of jobs is not all AI its just a great excuse to look like growth is happening in a downturn

naive pawn
#

cool, i don't really care how you use AI

queen adder
naive pawn
#

i care when i have to deal with the shit it generates lol

queen adder
naive pawn
#

not really

#

i do think you're being overly combative and defensive

queen adder
#

It's just like I took such a long hiatus from my passion game cuz of over analyzing and getting angry about other stuff. And I guess just blowing it off and being defeatist and yet last week I spent 3 hours straight working in blender to make my character looking up ways to integrate it into game maker. But I was just happy in the moment. Just listening to some rock music. Not even carrying what lies ahead

#

And that's when i'm most productive

#

But in the back of my head. I know you guys are right

#

I'm only setting myself up for more frustration and failure in the long run

#

Guess I'm just trying to have my cake and eat it too

#

Anyway, I'll shut up now. I'm just going to look at that c-sharp introductory course at the top of this channel. Hopefully won't bash my head in

naive pawn
#

tbh i think the best solution for you would be to find a programmer friend who's willing to go with your ideas but that's easier said than done

queen adder
#

Do I go in and break things or do I take it slow and try to force myself through the pain?

#

Either way I'm going to feel pain. It's just a matter of when

#

I'm a dopamine junkie just doesn't mix well with patience

#

But it's not like it can just rewire my brain. I can't fight my nature

#

I see coding as an enemy, an obstacle, something to conquer, something to punch metaphorically with just grit and trial and error. Not something to enjoy

twilit mica
#

Does anyone know 2d very well

bold kindle
twilit mica
#

I know the basics I jus need assistance

#

In coding and components

naive pawn
#

!ask

radiant voidBOT
# naive pawn !ask

:thinking: Asking Questions

:mag: Search the internet for your question!
:book: Use the API Scripting Reference and User Manual and this troubleshooting site for commonly posted issues.
:wrench: Attempt to debug your issue.
:thought_balloon: Find an appropriate channel by reading the name and description in #🔎┃find-a-channel
:grey_question: And don't ask to ask, ask a full question illustrating with screenshots if needed.

-# For more posting guidelines, go to #🌱┃start-here

queen adder
#

Game maker is a lot easier and faster at prototyping and most of the shaders and visuals you can use. In unity, you can find in game maker

#

I'm serious man. Save yourself the trouble. GML is a lot easier to learn than C sharp

naive pawn
#

unity for 2d is fine

queen adder
naive pawn
#

if you're just gonna be here disparaging other people then that's not a very good use of your time

#

the door is free to use

queen adder
naive pawn
#

ngl it's starting to sound kind of toxic

queen adder
#

But fine

polar acorn
naive pawn
queen adder
# polar acorn What mindset is that

Learning to code as you go to make your game instead of forcing yourself to learn the basics first by listening to some old codger babbling at you on a screen about variables and functions and loops and all that crap

queen adder
naive pawn
queen adder
#

I'm trying to prevent this guy from getting burnt out too fast

queen adder
naive pawn
#

unity is fine for rapid prototyping too

naive pawn
queen adder
shell sorrel
#

rapid protyping comes more down to familairty with a system then features

naive pawn
#

we recommended learning basics, not listening to lectures

polar acorn
polar acorn
queen adder
queen adder
queen adder
#

I'm not just making this game out of passion but anger too

polar acorn
#

That's entirely a you problem. If you can't work on improving yourself then you won't be making a game. Learning a complicated skill like this is about slow methodical self-improvement. You need to want to improve for no reason other than "It's fun to get better at things"

Extrinsic motivation will dry up. If you want to get to the finish line, you need to be motivated to learn for learning's sake

queen adder
#

I'm done rambling then for real this time

#

I'm just really afraid to get started

silver fern
#

start with something easy

#

whats stopping you

#

there's no point worrying about that, start doing and then you will find out

#

dont use ai for coding

#

its really bad

#

its not a purist mindset, the ai is actually bad for this

#

like, objectively

fickle plume
#

No need to restart this conversation. If you have coding questions, post them.

silver fern
#

that's because you don't have much experience yet

naive pawn
#

no-one's forcing you to be here. i gave you multiple outs. if you want to go use gamemaker, then go do so. if that will make you more productive or hate the process of making your project less, go do so.

#

what tactic, avoiding things i don't like?

#

heh, disclipline, wish i had that

naive pawn
#

not doing things i don't like. that's it. i'm not trying to restart a discussion here. there is an out, you have every opportunity to take it.

if you choose to stay this path, that is your choice and your choice alone. we don't need your ranting over something wholly avoidable.

cosmic dagger
#

If you know what the outcome is, then break your game down into separate pieces (game mechanic/systems). Keep breaking them down until you have a list of tasks for each part of your game. Now you have a bunch of starting points. Pick where you want to start, then learn. That's it. Good luck . . .

polar acorn
#

You know what doesn't help you make a game? Arguing on the internet.

shell sorrel
#

fundamentals does not meaning knowing everything. Even developers with decades of expereince are using documentation and looking stuff up daily

frosty hound
#

@queen adder Can you at least make a thread at this point, thanks

sacred shuttle
#

hello i have a question i just downloaded unity what game development guide should i watch to make my first game

radiant voidBOT
cosmic dagger
#

You do that along the way (learning the fundamentals). If you have any issues, errors, or coding questions, post here. People will help, but we can't make you or hold your hand to do it. As Osteel mentioned, start a thread for people to help or respond in so it doesn't take over the channel . . .

random lodge
#

How would you count the # of these?

cosmic dagger
polar acorn
#

If you ever find yourself numbering variables, you are doing it wrong

cosmic dagger
# random lodge How would you count the # of these?

Collections, such as arrays, lists, stacks, etc., keep track of the number of elements and provide methods to add, remove, and perform other operations. If you need x amount of something, then you need a collection . . .

random lodge
#

Hmm alright back to Google for more lol

shell sorrel
#

your case you want a List<T> or Array

polar acorn
#

You couldn't afford me

fickle plume
#

!warn 799077053721870336 Don't insult community members. Don't spam the channel with off-topic.

radiant voidBOT
fickle plume
#

!ban 799077053721870336 Spam, insults.

silver fern
#

if I want to show code here can I just link to it on my gitlab?

shell sorrel
#

or a code sharing site,

silver fern
#

but there's no rule against it I mean

shell sorrel
#

i would not link a whole repo, since thats asking alot for people to read it all

cosmic quail
#

!code

radiant voidBOT
cosmic dagger
#

Just don't give us the whole repo. small snippets are fine in the server with the proper formatting . . .

silver fern
#

https://paste.mod.gg/zktxbsnoufhs/0 I was trying to think of ways to avoid the big switch statement since the actual list of effects is even longer. But I can't come up with anything that doesn't end up in me doing a bunch of similar checks elsewhere later, except maybe writing a dictionary that groups the effects by constructor. Is that a worthwhile idea?

keen dew
#

I'm sure it's fine if you link directly to a file in the repo. I don't see how it's any different from using a paste site for the exact same file

silver fern
#

alright, yeah that's what I was gonna do originally

shell sorrel
#

what calls StartEffect

#

kind main issue is is you are mapping from a enum to a other type, so the way to avoiud the switch would be to not do that and pass it instead

#

Effect Object is it just a regular C# object?

silver fern
#

StartEffect can be called by a few different things that apply effects

shell sorrel
#

so generic method might do it

#

StartEffect<T> where T is one of your EffectObject types

#

as long as the constructoirs are consistient enough it should be able to create it as needed

cosmic dagger
#

I would make a struct for all of the parameters and pass that instead . . .

fading lynx
#

anyone ever have an issue with all file folders disappearing and no asset showing up even though it still runs?

frosty hound
#

You sure you're just not typing something in the search bar of the project window and it's returning no results?

fading lynx
#

I'm not getting anything it's like my whole folder list has vanished. I was doing a cleanup and doing a re-organize of the folders.

polar acorn
#

Can you show a screenshot of your unity window

silver fern
silver fern
shell sorrel
#

more or less CreateEffect(EffectType) becomes T CreateEffect<T>()

#

though ideally would try for a more data oriented way, what is different between all of these types?

#
public T StartEffect<T>() where T : EffectObject, new()
{
    var effect = new T();
    // Set Some common stuff on effect
    return effect;
}
#

though depending on the structure of things still some much better ways

silver fern
#

they don't really have much in common except for their structure

shell sorrel
#

it looked like to me most were having the exact same args pased to them

silver fern
#

yes but they do different things

shell sorrel
#

so would be able to construct them, and create them no matter the type with the above code i put

#

then just have a method on EffectObject that lets you set all the common dependencies and data

silver fern
#

well if I do that that moves the checking to the EffectObject but I still have to check for each type

shell sorrel
#

checking what though

#

if they all have totally different thigns passed you will need to handle that, but if they have things in common that can all be done as 1 step

fading lynx
#

I've noticed all of my UMA characters have disappeared as well, I can still move around but my avatar has disappeared.

fading lynx
#

oops sorry

polar acorn
#

Clear the search

silk comet
#

hey! I got a problem, I need to instantiate an object with a shadow caster and the shadows need to render. but when I do it in my build, it doesn't render any shadows. what can I do (no I can't make it without instantiating)

silver fern
#

my best idea so far at this point was to group the different calls in the switch by constructor so the switch is at least a little shorter

shell sorrel
#

well either that

#

or ditch the whole enum thing, make all of them in a central place and reuse them

#

then the thing calling StartEffect passes th actaul instance already amde

rich adder
silk comet
rich adder
silk comet
#

I'm with urp, where are my pipeline settings?

rich adder
#

in project settings.

silver fern
#

but that feels wrong

shell sorrel
#

if you need that just do a switch over the type its self

silver fern
#

yeah that's what I'm already doing

#

this is tricky

shell sorrel
#

also reflection just moves the problem but still is the same amount of logic

silver fern
#

maybe the switch is actually the best solution since everything is in one place atleast

shell sorrel
#

but now its slower harder to read logic

#

that or the generic method + a switch over hte created type, since it would atleast let you set all common things on one line

#

then deal with the edge cases after

silver fern
#

alright thanks

shell sorrel
#

in my case i just avoid the problem since all effects are created early on, and anything that needs one just holds a reference to it and passes as needed

silver fern
#

I see

#

I think that doesn't help in my situation but it's a good suggestion

shell sorrel
#

in my exact situation there were not that many code types for effects, since they were made in a data oriented way and a few effects just modify like player stats or something

#

and there is a generic way to do that already in the game

silver fern
#

mine can do all sorts of things, and I also need to be able to differentiate between buffs and debuffs as well as being able to end them early

grand snow
#

If there are buffs and debuffs, they can both inherit from the same Effect type and use some virtual bool property to indicate what they do

cosmic quail
silver fern
#

yep I'm already doing both of those things

eternal needle
naive pawn
#

what's the difference between setting Rigidbody2D.rotation and Rigidbody2D.SetRotation?
the 2d docs are kinda lacking and there isn't a 3d analog of SetRotation to extrapolate from

hot wadi
#

I am confused. I just used it few days ago and now it says CharacterController does not have Move method

silver fern
naive pawn
naive pawn
silver fern
#

I think you're not supposed to change the property directly

naive pawn
#

set rotation is also a method

naive pawn
hot wadi
shell sorrel
rich adder