#💻┃code-beginner

1 messages · Page 417 of 1

limber marlin
#

no, I don't want to use Unity VCS, I want to use Git, I want to know the recommended option for HOW to use Git (with the addon, or without the addon?)

So I'm just not gonna use the addon, and use Git with a CLI

rocky canyon
#

best option imo even tho i don't use CLI i wish i could

rich adder
#

you don't need any addons

#

just use a git client, github desktop works fine but others are good to. just showing the process real quick

limber marlin
#

yes, I went through it, I know Github Desktop exists, I choose not to use it, I'm going to use a Git Client

rich adder
#

they have many 🤷‍♂️

#

or use the CLI

limber marlin
#

CLI > GUI imo (except for looking at prior version history, but that's more that I'm not very good with the CLI)

summer stump
#

Set up git (git init the folder) then download some gui, it does not matter at all which

rich adder
summer stump
#

You set up the folder, use the cli. Done

limber marlin
rich adder
#

an app which communicates with the repository

limber marlin
#

and the git thingy you put into the path is NOT a git client

summer stump
rich adder
#

the .gitignore or ?

limber marlin
rich adder
#

yes that is the client

limber marlin
#

What you download, from here

rich adder
#

Windows

#

or whatevr you got

#

this is the client, not a GUI Client

limber marlin
#

ok, so I will use the Git CLI Client. Is this the correct terminology?

rich adder
#

correct

silk night
#

If you really want it easy use the github client, brings git bundled and you can directly manage your repositories, if you really want to learn it i suggest using the command line

rich adder
#

you mean github desktop client ? it was suggested

silk night
#

yeah, oh sorry didnt see that, shouldve read further back

rich adder
#

they said CLI > GUI 🤷‍♂️

#

for me its easier with gui to make a push while im eating pizza with my other hand 🍕

languid spire
silk night
#

Only mountain dew and cheetos permitted

rich adder
languid spire
rich adder
#

you code in one of those Cleanroom ?

languid spire
#

of course, you mean you don't

hexed terrace
#

My office is like a NASA clean room

rich adder
#

my cat alone puts furr in keyboard

rocky canyon
#

my computer wont operate correctly w/o 3 lb of dust circulating around teh case

languid spire
limber marlin
#

also I feel like an epic programmer with epic skills when using the cli

(should start using neovim too)

silk night
rich adder
rocky canyon
#

fr.. linux calling ur name

languid spire
rancid tinsel
#

any idea why toggling a bool on one of these changes it for all the others?

#

what could i have messed up here

silk night
rancid tinsel
silk night
#

Any scripts running on there?

rocky canyon
#

well, would u care to share the code? or are we gonna play guessing games

rancid tinsel
#

!code

eternal falconBOT
rancid tinsel
#

it was working fine until i added the Update() function

rich adder
#

so whats wrong with it?

rancid tinsel
#

toggling the "friendly" variable toggles it for all of the objects instead of just one

#

same with the other rvalues it seems

#

wait

#

OMG

rocky canyon
#

forloops say what?

rancid tinsel
#

i am a giga idiot

#

i had the inspector window frozen 😭

#

locked i mean

rocky canyon
#

u caught that suprisingly fast tho..

rancid tinsel
#

thank god

late burrow
#

how i disable repeats "aaa".replace("aa", "a") gives aa not a

polar acorn
languid spire
summer stump
#

And now we see more cracks of a string based system forming

late burrow
languid spire
#

so wtf ask then

late burrow
#

because if character repeats 20 times it will require many replaces

polar acorn
#

Regex

summer stump
#

Complete refactor 😸

languid spire
#

string processing is ALWAYS going to be slow, learn to do it correctly, not at all or suffer the hit

limber marlin
#

actually maybe if I do hca and get a laptop that I have to install linux on, but not

languid spire
polar acorn
thorn lake
silk night
#

Those are ide annotations, what IDE are you using?

#

oh nvm, you meant the text below

rocky canyon
#

CodeLens i believe it is

#

theres mixed opinions bout disabling it

glass aurora
#

how to download C# in extensions when i search c# it doest appear

rocky canyon
#

for what IDE/

glass aurora
#

another tpye of c# appears not the same as this

glass aurora
polar acorn
#

I don't think Visual Studio has extensions

glass aurora
#

dont be angry i am learning course since 5hours

#

see

polar acorn
#

There's modules, but that doesn't appear to be one

glass aurora
summer stump
#

Incorrect

summer stump
glass aurora
#

window 10

summer stump
#

Ok, go into tools, not extensions

polar acorn
#

Where are you seeing that you need to install any extensions on Visual Studio?

glass aurora
rocky canyon
#

c# isnt in an extension.. its a in the tools / workloads

summer stump
#

You want the workloads as digi said

glass aurora
summer stump
glass aurora
polar acorn
summer stump
rocky canyon
polar acorn
#

!ide shows how to get all you need for VS

eternal falconBOT
summer stump
rocky canyon
#

C# included in the Game Devlepment with Unity workload

glass aurora
glass aurora
summer stump
glass aurora
#

already

summer stump
#

And what else did you get?

rocky canyon
summer stump
#

Because the ide guide above shows everything you need

rocky canyon
glass aurora
#

bro it is already installed

glass aurora
summer stump
glass aurora
#

this guy have another?

rocky canyon
polar acorn
summer stump
glass aurora
glass aurora
summer stump
#

Visual studio

rocky canyon
#

you have visual studio u said

glass aurora
#

bro what the hel!

rocky canyon
#

vscode is blue

#

visual studio is purple

glass aurora
#

😢

#

leme download it

#

how to downlaod it properly guide me what to download and etc

#

ide=?

polar acorn
#

use the one you have

rocky canyon
#

theres already a guide its been linked over and over

glass aurora
#

ok

thorn lake
glass aurora
#

!ide

eternal falconBOT
rocky canyon
#

the vscode one.. if u want to use vscode

glass aurora
#

they say install via unity hub and mannualy on studio

#

then vs code

#

then jetbrains rider's brain

rocky canyon
#

u dont need studio && code

glass aurora
#

then other/none

rocky canyon
#

u only need one or the other

glass aurora
#

plz

summer stump
glass aurora
#

nah idk but ... eeeee

#

i should download it how much gb ?

#

my wifi speedi 20MB but i got 200-500kbs on my pc

summer stump
rocky canyon
summer stump
#

Just go google it and stop spamming the chat

polar acorn
summer stump
#

If you have trouble AFTER googling it, we can help

glass aurora
thorn lake
# rocky canyon

Wait….if I’m only using the blue one here is that a potential issue for autofill?

summer stump
rocky canyon
#

you need a bit more extensions to get good autofill

dense cargo
#

(Sorry in advance if this is in the wrong spot).. Why might my trail renderers for my planet objects (and moons since ya know...same functions there in another script) be behaving as shown in the picture when the scene loads? Code for the trail renderer initialization/control attached.
https://paste.myst.rs/btzxh445
https://paste.myst.rs/ztflnwln

rocky canyon
thorn lake
#

(Besides the ones you said to ignore)

rocky canyon
#

Unity Code Snippets is the most important

thorn lake
#

Thanks sm!

rocky canyon
#

its hard to know which one does which. b/c codieum is an AI tool.. and it helps fill in almost everything

thorn lake
#

Is this the best channel to ask for help with figuring out why a small program isn’t working in some way?

frosty hound
#

If it's related to code, yes

dense cargo
thorn lake
#

Okay. Yesterday I posted a message here with code I needed help with. I’ll grab the link to the message.

Essentially the issue is that it wasn’t visually changing the Scene at all once uploaded. Not sure if I needed to press Play or what. Idk why it doesn’t change anything.

#

Didn’t have any compiler error messages.

#

My question: Why might this code not change anything in my Scene?

#

Or just, in general, could something prevent a scene from updating?

glass aurora
#

what should i select for C# For Game dev etc

#

anyone kindly tell me

rich adder
#

this is inconsequential welcome screen

#

just mark done

glass aurora
#

which?

polar acorn
#

Mark Done

rich adder
#

Mark Done

polar acorn
#

The button that says Mark Done

glass aurora
#

without sleecitng

rich adder
#

blue text usually indicates a link

glass aurora
#

bruh what is this?

#

it says "i am in your pc"

#

is that vs code? i downloaded cracked apk of vs code

cosmic quail
#

wtf is that lol

rich adder
#

apk version of vscode?

summer stump
glass aurora
summer stump
#

Looks like a virus. Good work

summer stump
#

Vs code? No

glass aurora
#

yo baby?

#

bruh who is on my dc!

rich adder
#

there is no apk version of vscode

#

whatever you smokin let me get some

glass aurora
#

who are you

glass aurora
#

what the helll

#

wait i am restarting

rich adder
#

alright

frosty hound
#

@glass aurora Enough spamming this discord with your nonsense. You've been at this for days.

glass aurora
#

how to remove users from pc ?

#

anyone?

rich adder
#

format your harddrive and call it a day

rich adder
#

this isn't a PC support channel

glass aurora
rich adder
eternal falconBOT
rich adder
#

you've been linked to the guide

#

follow it and stop wasting ppls time

glass aurora
#

in preference then select that right

summer stump
#

Like six times now

polar acorn
rich adder
glass aurora
summer stump
#

Because they're a troll

polar acorn
dense cargo
summer stump
#

I am mad at them now
Like jfc, stop lol

rich adder
#

nah def not because of beginner, many beginners come here and get help no problem.

polar acorn
glass aurora
#

language issue because sometimes i cant understand english

rich adder
#

I just interacted with them 5 mins and already I'm mad lol

summer stump
rich adder
glass aurora
polar acorn
#

You seem to understand us just fine, but not when it's on your PC, which you can change the language of

rich adder
glass aurora
rich adder
#

when you are asking questions that can be easy to google answers for that shows lack of care of responsibility for self improvement

rich adder
summer stump
glass aurora
#

well i dont wanna waste my time here in a useless debate you both grow up first. You Both are Exper at dev but still blaming ppls.

polar acorn
#

Anger is kind of the expected reaction to wasting people's time with asinine bullshit

frosty hound
#

!mute 1126119936369102958 3d You can return if you are going to actually be productive.

eternal falconBOT
#

dynoSuccess _notfurry_ was muted.

rancid tinsel
#

do navmesh agents work like obstacles? as in 2 agents cant walk through eachother?

rich adder
#

they avoid each yes RVO is built in

#

which can be annoying sometimes they get stuck in tight hallways

rancid tinsel
#

im trying to think of a way to prevent that but idk how

rich adder
#

You have to try varying the priorty of their agents

rancid tinsel
#

rebaking the navmesh at runtime over and over would be very inefficient too

rich adder
#

they can't all be 50

#

someone needs to be "priority"

rancid tinsel
#

ah i see

#

so as i spawn them in i should assign an increasing priority

#

put them all into a list and do it that way?

rich adder
#

so lower = most priority

rancid tinsel
rich adder
#

rip

rancid tinsel
#

my rigidbody and nav mesh agent wont uncollapse

#

time to restart unity i guess

rich adder
#

which version are you on?

rocky canyon
rancid tinsel
#

2022.3.10f1 because thats what we were using at uni

rich adder
#

you are many patches behind

rancid tinsel
#

i know

#

but i think its still better to use the same version just so everything works the same

rocky canyon
#

you should take initiative and write a strongly worded letter to whom-ever it concerns

#

and let them know to update 😈

rich adder
rocky canyon
#

idk why so many schools use old af versions

#

i seen a guy the other day using a versions before dark mode

rancid tinsel
rich adder
#

to fix bugs?

#

like known bugs

rancid tinsel
rich adder
#

maybe you're think a whole version upgrade. which *might * be tricky for *specific * assets

rancid tinsel
#

unless its really needed they wont bother

languid spire
rocky canyon
#

phew... 😅

rancid tinsel
#

i mean aside from some errors that dont mean anything that you can disregard it doesnt really break anything

#

aside from the necessary occasional restart

rocky canyon
#

yea, if ur fine restarting time to time.. no worries

languid spire
#

and, of course, the perennial UnityEditor bugs which keep springing up

rocky canyon
#

part of the lifestyle as i see it now 🤣

languid spire
#

thats what you get when you expect game devs to do app dev

vale karma
#

Im getting a weird issue where the plant that is not picked up yet by the player is having origin issues or something around the player once it is placed on the cart. I will send scripts ina sec

#

All the plants, the tray, and even the cart have the same exact script on them to pickup. Im not sure if its a parenting issue or not

rancid tinsel
#

hmm setting a different priority didnt fix the pushing issue

#

im guessing the avoidance is in regards to obstacles?

#

it doesnt seem to work on the agents themselves

hallow acorn
#

hey how can i get the tag of the object hit by my raycast?

summer stump
hallow acorn
summer stump
#

Yeah that works.

hallow acorn
hallow acorn
summer stump
winter tinsel
#

im fully lost

#

it wont destroy the gameobject

summer stump
# winter tinsel

1, use CompareTag
2, add a debug BEFORE the if statement to see if OnCollision is even being called

#

3, uncrop the image of the tag. What is it on? Show the whole inspector

winter tinsel
winter tinsel
#

i minimised everything , if you need details on individual components ill send that too

summer stump
winter tinsel
#

right

#

§

summer stump
#

debug.log("is collision being called")

Just do this

#

But it is the dollar sign for string interpolation
$

hallow acorn
winter tinsel
summer stump
terse plume
#

components that listen to events...
register and unregister on enable/disable?
vs
stay always registered and just exit early if the component is not active?
👀

summer stump
winter tinsel
#

first

#

amazing

winter tinsel
winter tinsel
# winter tinsel

not even called somehow even though the bodies to act like they collided, the physics work

summer stump
#

Oh. Nm

#

You are doing 2d

winter tinsel
#

yes

summer stump
#

You need OnCollisionEnter2D
OnCollisionEnter is for 3D

winter tinsel
#

i want to make a 3d game but tahts for later rn just familiarising myself with the engine and the language

winter tinsel
summer stump
#

3d is not any harder really. They are about the same difficulty (or 2d is more difficult in some ways haha. I struggle with it more due to having more experience in 3d than 2d)

winter tinsel
#

ah

#

i tried gadot before this

#

mess

#

absolute mess of an engine

#

btw, excuse me?

winter tinsel
summer stump
#

Collision2D is the parameter

summer stump
winter tinsel
#

i know

#

its like doom but reverse

halcyon dagger
#

any way to invert the selectable options firection in the editor?

winter tinsel
#

instead of 2.5D its 3D-(0.5)

summer stump
#

I would not call Godot a mess really. It is quite good. I list it third in my favorite engines. Bevy and Unity battle for 1.

winter tinsel
#

since its techincally 2d with illusions to make it 3d

#

unity is reverse

#

its 3d and its 2d but with illusions

summer stump
#

Ok, I get that. Makes sense

winter tinsel
#

its 3d (Behind the scenes)

#

like doom is 2d(behind the scenes)

winter tinsel
#

another IF within the void?

#

what do i put in the if block?

summer stump
#

Could that work?

winter tinsel
#

i need it to not collide with the player

#

but i need the player to still have a collison lol

summer stump
#

Ok, put the player in a Player layer and disable collisions between those specific layers in the collision matrix

#

Tags are only relevant after the collision has already occurred

winter tinsel
#

aha

#

where do i disable them

#

is it in the inspector or is it codable?

#

wait i found

#

layers okay

summer stump
#

It is in settings. One sec

#

Oh, the layer itself, yes

#

That is in the inspector

winter tinsel
#

what is the player layer?

summer stump
#

Matrix is in Edit > Project Settings > Physics (and be sure to go to the 2d section)

summer stump
#

It is not there by default

winter tinsel
#

ah

winter tinsel
#

if they should be disabled

#

or enabled

summer stump
#

Otherwise, Edit > Project Settings > Tags and Layers > Layers

winter tinsel
#

it was the second one

#

okay i can make a new layer how do i connect it to the player=

#

also in the inspector

#

found it

#

ok thanks man

sand otter
#

I have my enemy with a navmeshagent and its hitbox is slightly to the right. Is there a way to move it?

wintry quarry
#

I think it's more likely your mesh is the thing that is not positioned properly

frank zodiac
#

gameObject.activeSelf checks if the gameobject is active right?

#

because mine doesnt seem to work

summer stump
frank zodiac
summer stump
#

Because if it is inactive, update is not called

summer stump
frank zodiac
#

Oh right

frank zodiac
river quiver
#

i know why the properties in animation editor turned yellow. cause in the docs of SetCurve instead of position.x its localPosition.x, idk why it works this way but it does work

hallow acorn
#

pls help me i have no idea how i can fix this mess. somehow my grab and throw script resets the force applied to my projectile in other scripts and i get nullreferenceExceptions on a few lines if i try to drop for example https://gdl.space/opupexoqan.cs (script used for grabbing and throwing) https://gdl.space/atetotumun.cpp (script used to shoot my projectile)

#

also my object doesnt move when i try to grab it

polar acorn
#

What line is throwing the null reference exception

hallow acorn
#

wait

#

35

#

i think in the drop "section" too but it doesnt show bc i cant even grab it

polar acorn
#

if (objHit = true && raycastHit.transform.CompareTag("Grabbable"))?

#

You aren't checking if you actually hit something there

#

You're setting objHit to true

rocky canyon
#

== ftw

hallow acorn
#

oh.

hallow acorn
rocky canyon
#

thats the comparison operator

#

if equal

#

= assigns things

#

two different things

hallow acorn
#

ok thank you need to refresh my coding skills havent made something since half a year

rocky canyon
hallow acorn
summer stump
rocky canyon
rocky canyon
#

😈 😅 ❤️

#

if it weren't for comments on my own code id lose my mind

#

especially after returning to a script i havent worked in a while.. "wtf was i doing here"

hallow acorn
rocky canyon
#

im big into <summary> now

#
        /// <summary>
        /// Get a direction vector corresponding to the specified cardinal direction.
        /// </summary>
        /// <param name="direction">The cardinal direction.</param>
        /// <returns>A vector representing the specified direction.</returns>
        public static Vector3 GetDirection(Direction direction)```
hallow acorn
rocky canyon
hallow acorn
#

this is so insanely cool

#

i love it

rocky canyon
#

i agree.. u should start using em 😉

hallow acorn
#

damn bro how did you learn this power where can i learn this mighty weapons please tell me

rocky canyon
#

u can basically comment every section of ur function

hallow acorn
hallow acorn
rocky canyon
rocky canyon
#

i just found out how

hallow acorn
rocky canyon
#

they just happen to be redundant

#

if u miss one you'll notice the other

#

theres also [Tooltip("Describe this variable in the inspector")] public float weirdFloat;

hallow acorn
#

ok i dont get any nullReferenceExceptions anymore but my drop function doesnt even get called (no debug.Log) and my grabAndThrow scripts still resets the force applied in toher scripts :(

rocky canyon
#

welp, time to track it down

#

why no debug log? figure that out first

hallow acorn
rocky canyon
#

exactly.. when coding thats a super fitting phrase

hallow acorn
rocky canyon
#

when ur project corrupts.. have a backup

rocky canyon
#

i actually havent looked at ur script.. im just thinking basic debugging steps in a general sense

hallow acorn
rocky canyon
#

use version control

#

github for example

#

whats ur code look like now.. i think u need to share it for anyone to help diagnose why the no debug log etc

hallow acorn
rocky canyon
#

!code paste it into a bin website so its referenceable

eternal falconBOT
hallow acorn
rocky canyon
#

ok so it hasnt changed any? cool

#

which part are u working on?

hallow acorn
#

why doesnt it switch to my else on line 41 im boutta cry fr

rocky canyon
#

debug this function

#

put a debug in the first if and the second if

#

Grab() must not be running somewhere..

#

i bet the 2nd if never gets true

hallow acorn
#

i have a debug in my grab function so it comes to the second if means the first one gets called to. but also i can grab multiple object(i get multiple debugs) so i think it just doesnt get not null idk why

#

i think im onto something

rocky canyon
#

i set my item to null when i look away..

#

the other part of it uses E to interact.. and it checks if theres a cachedInteractable.. and then interacts w/ it

hallow acorn
#

ok i have absolutely no idea what you mean haha

rocky canyon
#

u cast a ray when u press E

#

i cast a ray non-stop.. and then the If(pressedE) part is seperate..

#

if theres an interactable i cached i do something... if theres not i ignore the keypress

#

(raycast still casting)

raw token
rocky canyon
#

i also expose the variable in the inspector

#

soo i can see what im interacting with

hallow acorn
#

btw this is the tutorial i used as a foundation bc i had no idea of raycasts and whatever. https://youtu.be/2IhzPTS4av4?si=Qqkl2sKdIcTSKOVb. but i dont like his coding style its so unreadable with is

//blablabla
}```
these if chains can get insanely confusing very fast

🎮Get the Synty Shops pack https://cmonkey.co/synty_shops_pickupdrop
✅Get the Project files and Utilities at https://unitycodemonkey.com/video.php?v=2IhzPTS4av4
🌍Get my Complete Courses! ✅ https://unitycodemonkey.com/courses
👍 Learn to make awesome games step-by-step from start to finish.
👇 Click on Show More
🎮 Get my Steam Games https://unitycod...

▶ Play video
rocky canyon
#

switch statements are cool

hallow acorn
rocky canyon
#

switch statements = cleean

hallow acorn
rocky canyon
rocky canyon
#

i personally think he codes messy and complicated

rocky canyon
fading mountain
#

are you guys talking about C# or is switch statements another language?

hallow acorn
fading mountain
rocky canyon
#
using UnityEngine;
using System.Collections;

public class ConversationScript : MonoBehaviour 
{
    public int intelligence = 5;
    
    
    void Greet()
    {
        switch (intelligence)
        {
        case 5:
            print ("Why hello there good sir! Let me teach you about Trigonometry!");
            break;
        case 4:
            print ("Hello and good day!");
            break;
        case 3:
            print ("Whadya want?");
            break;
        case 2:
            print ("Grog SMASH!");
            break;
        case 1:
            print ("Ulg, glib, Pblblblblb");
            break;
        default:
            print ("Incorrect intelligence level.");
            break;
        }
    }
}```
hallow acorn
rocky canyon
#

they're great for going thru Enums

hallow acorn
rocky canyon
#

unity's prints

hallow acorn
#

btw is there a difference between print and debug.log??

rocky canyon
#

yes debug.log can take in a 2nd parameter

hallow acorn
#

oh ok

rocky canyon
#

u can send the reference to it

#

so u can double click it and see what sent the message etc

hallow acorn
queen adder
#

Im wanted to make something happen when only colliding with a certain object it says I need to define the tag

private void OnCollisionEnter2D(Collision2D collision)
{
if (collision.collider.CompareTag("Bullet"))
{
takeDamage(1);
}

}

hallow acorn
polar acorn
queen adder
#

No i dont... How do i make a tag

hallow acorn
#

dont forget it is not set to the object automaticly after creating the tag

foggy orchid
#

Hey, I'm new to unity and I'm just now learning programming so I'm going through the tutorial. But on section of the tutorial where I add the movement script I keep getting this message, Can anyone help?

queen adder
#

Thank you it fixed it so when using a string I need to make a tag for it?

summer stump
queen adder
#

Okay thanks

ivory bobcat
glad rune
#

why are my particles invisible when i change the color of the material

ivory bobcat
thorn lake
#
initialRoom.GetComponent<Room>().roomIndex = roomIndex;
#

For the aboveline of code I'm getting the following error:

#

wait it won't let me copy the error...

#

Thought I could just right click in the console and click copy but right clicking isn't opening that

ivory bobcat
#

I'm guessing a null reference exception error or unassigned reference exception error

thorn lake
#

'Room' does not contain a definition for roomIndex' and no accessible extension method 'roomIndex' accepting a first argument of type 'Room' could be found (are you missing a using directive or an assembly reference?)

ivory bobcat
#

Make sure to have your !ide configured

eternal falconBOT
languid spire
ivory bobcat
#

You should not have been allowed to type .roomIndex

#

Intellisense should have underlined it or not auto complete it.

thorn lake
# ivory bobcat Make sure to have your !ide configured

I've followed those steps, still isn't allowing autofill for some things. It's not underlined. I did notice that Room (and other Objects) are all the same color as variable names. Currently using the blue Visual Stuido application and not the purple one. I know the purple one has more features so maybe I just need to swap for that one

hard yoke
#

would this be a place i could ask for help about my game not building and throwing a error

thorn lake
#

It's been about 4 to 6 years since I've been into coding so I'm pretty rusty

ivory bobcat
languid spire
ivory bobcat
#

Possible reasons may be:

  • Room doesn't have anything called roomIndex and that this was a bad/dirty port (copy/paste)
  • Room is referring to something other than what you think it is (auto import of an incorrect name space with something other called Room)
  • There is no Room and the error is a false positive due to us neglecting an error about directives prior to this error
hallow acorn
#

@rocky canyon I DID IT! i just swapped the objectGrabbable value which is always null with a bool which is et to true if i grab something and to false if i drop something. the grab function just gets called if the bool is false else it switches to my else containing the drop function it finally works im so happy right now omg

thorn lake
#

not sure why it needs to be capitalized. Must just be the wat C# works with classes ig

ivory bobcat
#

Make sure to configure your ide to prevent simple errors like these.

thorn lake
#

I need to review the difference between classes and objects. It's been wayyyy too long

polar acorn
raw token
thorn lake
languid spire
ivory bobcat
polar acorn
thorn lake
eternal falconBOT
thorn lake
#

oh wait

#

it looks like my IDE did catch that originally

#

I had gone back and changed it to a lowercase thinking it was an error earlier

#

not realizing that it was not an error

#

What confused me was seeing roomIndex as lowercase in my input parameters for the function and then uppercase later in initialRoom.GetComponent<Room>().RoomIndex

hallow acorn
#

sry but can somebody tell me why my grabbed object doesnt move at all? even though all of the debug.logs say it should work.. https://gdl.space/enezineley.cs

ivory bobcat
thorn lake
ivory bobcat
#

Without a configured ide, you'll trip and stumble every step of the way on your journey with Unity and folks will immediately know if you do not have a configured ide

queen wren
#

Sorry guys, I'm getting this warnings:

The referenced script on this Behaviour (Game Object 'SolarySystem') is missing!```

But I can't find what object/s that have this  missing files... any idea?
thorn lake
queen wren
#

also the Game Object 'SolarySystem' is absolutely fine 😒

#

Ohhh... it's a prefab! 😅

thorn lake
#

I've noticed I have an error msg about not having any .NET SDKs tho

queen wren
#

lol now it's fine 🤭

vast vessel
#

wait, this cone casting script dosnt check for occlusion

eternal needle
vast vessel
#

anyways, are there any better ways then the second way i said

vast vessel
#

its just a sphere cast with an angle check lol

#

basically what i described without occlusion checks

hallow acorn
polar acorn
#

Also objectGrabPointTransform

hallow acorn
polar acorn
#

The object is moving, but since the object you've dragged in doesn't actually exist you're not gonna see anything

hallow acorn
thorn lake
#

I think I'm not entirely sure what constitutes "configured enough" for my IDE in terms of requirements for asking for help here. I think it's configured all the way.....

ivory bobcat
#

Syntax highlight and auto complete specific to Unity

hallow acorn
polar acorn
thorn lake
#

Does Syntax highlight just mean where if you highlight a variable it highlights all variables w/the same name?

polar acorn
hallow acorn
polar acorn
hallow acorn
polar acorn
#

You're checking its tag

thorn lake
ivory bobcat
quick fractal
#

I am aware this is an incredibly basic question but, ᴴᵒʷ ᵈᵒ ᴵ ᶜʰᵉᶜᵏ ᵗʰᵉ ⁿᵃᵐᵉ ᵒᶠ ᵃ ᴳᵃᵐᵉᴼᵇʲᵉᶜᵗˀ 🥺

hallow acorn
ivory bobcat
quick fractal
#

Thank you

polar acorn
#

So get the rigidbody from that the same way

hallow acorn
quick fractal
# polar acorn `.name`

I do have another question if you're willing, how would I go about lerping the emission value of more than one skinned mesh renderer?

ivory bobcat
quick fractal
polar acorn
quick fractal
#

Wait I might be an idiot

#

I'm trying to set the smrs colour.. Didn't even get the materials 😭

rocky canyon
#

and u can remove PlatformIO from ur extensions.. (thats for programming computer chips)

#

you can get the sdk from microsoft

#

i use .net 8.0 since its Long Term Support version (x64)

ebon vessel
#

I have formatted my pc and backup my files before the formatting. But when i tryed to open my project, unity said that i need to open the project in the safe mode. So i opened the file as safe mode and this screen has appeared. What should i do in this situation?

summer shard
#

how would i go about making objective system without needing to create loads of c# scripts or loads of classes

silk night
summer shard
rocky canyon
#

objective system gonna be a hand-ful of classes regardless what u do

native seal
#

is it recommended to use object pooling to create VFX effects using vfx graph? For example, i'm trying to make a death effect on an enemy but the enemy is being destroyed so the effect doesn't play. Is it better to make some VFXManager which creates an object (object pooled) at the location to play the effect then is removed after it's done instead of holding the "visual effect" compoennt on the enemy itself?

rocky canyon
#

someone just had the same issue yesterday, had to unparent an effect just to keep it fading away after his obj was destroyed

summer shard
rocky canyon
#

its probably abunch of classes deriving from a base class

#

that has all the common functionallity in

silk night
rocky canyon
silk night
#

Or load a csv/json with objective data, whatever suits best for you, scriptable object is most likely best cause you can reference prefabs and other internal unity stuff without matching IDs

rocky canyon
#

i would search "objective system unity"

#

and see what u can learn about it

summer shard
#

So just class "Objective", "ObjectiveManager" and storing "Title", "Id", "CompleteEvent" etc?

#

and like adding objective component to triggers, interactables etc?

silk night
rocky canyon
#
public abstract class Objective : ScriptableObject
{
    public string Title;
    public string Description;
    public bool IsCompleted;

    public virtual void CompleteObjective()
    {
        IsCompleted = true;
        Debug.Log($"Objective Completed: {Title}");
    }
}```
#

public List<Objective> Objectives;

summer shard
#

wait, ScriptableObject? what's that

rocky canyon
#

something u should learn about

#

heres a scriptable object

#

im using it to hold all my player data

#

i can slot in a different one w/ different values if i like.. and it'd work

summer shard
#

ohhhh, yea now i understand

rocky canyon
silk night
#

If you want a real-world example, see it as a physical quest board in the town hall

Your board is the ObjectiveManager
The ScriptableObject Objective is the paper you can fill out to pin at the board, you can pin as many at the wall with different data as you want

rocky canyon
#

and on my player controller.. it just grabs the values

native seal
summer shard
rocky canyon
#

yes, as many as objectives as u have (many scriptable objects)

silk night
rocky canyon
#

like i said earlier.. theres really no way to not have lots of files... if u want lots of objectives

#

u could put everything in 1 master class. but thas bad

#
public class ObjectiveTrigger : MonoBehaviour
{
    public ObjectiveManager ObjectiveManager;
    public Objective ObjectiveToComplete;

    private void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("Player"))
        {
            ObjectiveManager.CompleteObjective(ObjectiveToComplete);
        }
    }
}``` this could be a trigger for example
#

u just slot in ur objective that would be marked as complete when u enter

#

(this one being re-useable ofc)

native seal
rocky canyon
#

sounds like its something ur familiar w/

#

i say go for it

native seal
#

👍

summer shard
#

hmm can i do something like that? and adding that class as a component to other game objects to trigger "completed" Event?

public class Objective : MonoBehaviour
{
    [SerializeField] protected UnityEvent completedEvent;
    [SerializeField] protected string title;
    [SerializeField] protected int id;
}
rocky canyon
#

i dont see why not

#

the scriptable object idea is u dont need it on a monobehaviour for it to work

#

a MonoBehaviour would need a gameobject

radiant frigate
#

hi! is it okay to use a while loop inside a coroutine?

rocky canyon
#

as long as u can break out of it

eternal needle
radiant frigate
#

okay, and another one if i may, is there a way to make a collider become a trigger for certain objects? (example: i dahs towards an enemy and i dash through it, but the enemy collides with the walls)

trail harbor
#

Is Kinematic Character Controller still the go to? or better options? 3D 3rd person

eternal needle
rancid musk
#

how many hours on average would you say it would take to learn the absolute fundamentals of c#

rocky canyon
radiant frigate
eternal needle
silk night
radiant frigate
#

havent used navmesh so i wanted to know if it makes sense or if it would just phase through the walls

rancid musk
rancid musk
rocky canyon
silk night
eternal needle
radiant frigate
#

okay, ty!

rancid musk
rocky canyon
#

50-100 hrs

rancid musk
rancid musk
rocky canyon
# rancid musk okay. what way did you go about learning from square one? I'm happy for this to ...

Welcome to this introduction to game development. We'll be starting from the beginning, so no prior knowledge of programming or the Unity game engine is required.

Unity can be downloaded here: http://unity3d.com/get-unity

Watch episode 01: https://youtu.be/9iCnjdXEfMA

If you'd like to support these videos, you can make a recurring monthly don...

▶ Play video
#

this series taught me the basics.. and then i just went hamm on google

eternal needle
# radiant frigate okay, ty!

One thing as well, if you use a trigger then the person dashing would be able to go through walls or fall through the floor. Depends how you're moving like a rigidbody will fall through by default

rancid musk
silk night
rocky canyon
#

good resources in there

rancid musk
rancid musk
eternal needle
rancid musk
#

where should I do that?

#

if it would be helpful then I'm happy to

rocky canyon
#
#

is the best resource for basic C#

#

u can do that along-side the unity stuff.. or do it first.. i skipped it. but i had some knowledge of coding

rancid musk
#

okay thank you all

eternal needle
#

There is also the Microsoft learn site, I havent used any of them in a loooooong time but ms learn is often recommended now

rocky canyon
#

word?

eternal needle
#

It's what I see recommended in some other places, and by other people here

rocky canyon
#

well i b a sonofa

eternal needle
#

W3 was pretty good to me for a lot of other languages but now that I think about it, dont think I ever used the c# one too much

rocky canyon
#

i thought microsoft only had docs.. TIL

#

lol.. 13!

#

it doesn't even show 9 anywhere. guess ud have to hunt for it

eternal needle
#

at the most basic level, i dont think anything changed so it shouldnt really matter which version they use

radiant frigate
#

a layer collision matrix is way more efficient than a Physics2d.IgnoreCollision() right?

real inlet
#

I need help with the way a script interacts with/references an input map - can I ask about it here? I am a beginner programmer so I may need beginner help

silk night
silk night
radiant frigate
#

that the player ignores objects in the enemy layer

silk night
#

Oh yeah in that case setup the matrix 😄

radiant frigate
#

ty!

real inlet
#

I have two characters in my 2D scene and two input maps. As it stands now, I also have two seperate scripts, for movement. I'd like to make one script that has a slot to assign an input map, just to streamline things. I've tried to achieve as such by doing what I did below -

public InputActionAsset _fieldControls;

private void Awake() {
    _fieldControls = new InputActionAsset();
    ...
    _moveAction = _fieldControls.Player.Move;

which does result in getting the option to choose the input map when attaching the script to an object like shown.

#

However, it results in the compiler error, also attached to this as an image. How can I fix it so that I can assign an input map to the script outside of the .cs file but still have that script work with that map?

twin pivot
#

question

#

is the OnMove function started when the objects position is moved

slender nymph
twin pivot
#

or just updated

#

the latter right

slender nymph
#

also the InputActionAsset does not have that property on it, if you were generating a C# class from the input action asset then you'd invoke that class's constructor and it would have the relevant properties on it

slender nymph
real inlet
slender nymph
#

no

twin pivot
slender nymph
#

no it isn't. it's a message created based on the name of your input action(s). it is invoked by the PlayerInput component when your input state changes for that input action

real inlet
# slender nymph no

Oh. How would I make it so that I can choose what input map to use like it is here in a way that works with the script?

slender nymph
slender nymph
real inlet
slender nymph
#

and why is that not sufficient?

twin pivot
slender nymph
#

so? that doesn't invalidate anything that i said

twin pivot
lament jetty
#

i need help with procedual generating rooms if anyone could help that would be amazing

slender nymph
# twin pivot what exactly does the onmove do then

whatever the fuck you want it to do. it's a method that you define in your script. and you put what you want inside of it. it is invoked by the PlayerInput component when your Move input action's state changes (like i already told you)

summer stump
real inlet
# slender nymph and why is that not sufficient?

Because I want to be able to create one script for movement, then attach that script to two different player objects, being given the option to choose which input map the script uses when I attach it to the object. I'm not trying to switch the input map from one to the other on a single object

twin pivot
#

was asking for how it was invoked

slender nymph
slender nymph
twin pivot
#

thats why i corrected my phrasing

#

and changed to was

summer stump
summer stump
#

Yes

real inlet
summer stump
twin pivot
#

im running on no sleep rn

#

brain not braining

slender nymph
real inlet
summer stump
#

Sure it does
Why can you not check what a script is attached to from inside a script?

slender nymph
real inlet
real inlet
slender nymph
summer stump
summer stump
summer stump
real inlet
#

ty

slender nymph
#

or it's as simple as a serialized boolean or enum to determine which action map to enable

summer stump
#

A serialized enum would be nice

slender nymph
#

because you just need an if statement to determine which of your action maps need to be enabled

#

as i already said

real inlet
slender nymph
#

the documentation pinned in #🖱️┃input-system will teach you how to use the input system. from there it's just a matter of knowing the absolute basics of c# to write an if statement

real inlet
#

For pete's sake, dude. I know how to write an if statement and I know how to enable and disable input maps. I do not know how that would solve my problem without the ability to check what object the script is attached to. I'm trying to figure out how to do that - if you're not willing to help me figure that out, just say so and move on

slender nymph
real inlet
slender nymph
#

no, but making a field show up in the inspector should be something you already know how to do

real inlet
slender nymph
#

then start with learning the basics. the pathways on the unity !learn site are a good place to start

eternal falconBOT
#

:teacher: Unity Learn ↗

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

slender nymph
#

and maybe also consider reading the rest of your code because you have been making fields appear in the inspector already

twin pivot
slender nymph
#

be more specific about what exactly isn't working

#

also maybe consider using a site other than hastebin since it likes to take forever for the code to actually appear on the site

twin pivot
#

im following the player movement thing on learn.unity but its just not working

twin pivot
bitter sequoia
#

guys, I want to trigger a function in a class for multiple instances of the same script.
Like the enemy, when I run the walk script in the enemy script all other enemies also trigger that script.
This is the list of event types I found:
Delegates, Event Delegates, Actions in Unity, Unity Events, Scriptable Object Events
But yeah chatgpt is just suggesting SOE and it's too much.

slender nymph
twin pivot
#

ah thanks

real inlet
#

I did not realize that box was called the inspector - that's my bad. Dumb misunderstanding on my end. Okay. I do know how to make fields appear in the inspector, but I don't know what a serialized boolean is in this context nor how I would implement it. Would I just declare like "public Boolean thisIsAboolean;" in my script and get a T/F field in the inspector?

#

Fair point. I will do that now

twin pivot
real inlet
#

Okay. Cool. I'm sorry for needing my hand held on something that simple and silly
Is there any chance there's documentation anywhere that has like a list of what variable types can be fields in the inspector?

eternal needle
twin pivot
slender nymph
#

is the rigidbody kinematic

#

also have you confirmed that your OnMove method is being called

eternal needle
twin pivot
real inlet
bitter sequoia
slender nymph
slender nymph
twin pivot
#

ah

#

looks like im stupid

eternal needle
#

i dont use static events often but this seems like an ok use case for it

twin pivot
#

the player input component just detects what key is pressed right

twin pivot
#

thanks

waxen adder
#

Bit of a general question. How do people tend to do player characters in games? If I'm to be more specific, do you add character controllers, colliders, and rigidbodies? What are your settings for those things?

wintry quarry
waxen adder
#

Let's do it from the perspective of a first person game

#

If that helps anyway

wintry quarry
#

Still very vague

#

Dear Esther and Apex Legends are both first person games

#

And they have extremely different needs and character control styles

waxen adder
#

Fair point. Might need to think about this a bit more

queen adder
#

Hello, im relativly new to csharp and unity in general but for me to learn its best if i experiment and i was wondering if anyone knows a good first person controller tutorial ish

waxen adder
#

^ You can't go wrong with Brackeys! Even though his tutorials are old and there might be new features to mess with, they tend to be very clear and concise

waxen adder
wintry quarry
#

Unfortunately Brackey's popular FPS controller tutorial has some glaring unfixed errors in it. But it's generally decent

wintry quarry
#

You will do all the movement through the Rigidbody

waxen adder
#

Gotcha

thorn lake
#

I currently only have the blue option (VisualStudio Code) and was recommended to download the purple one. I didn't realize there's be multiple options. Which of them would be best just for some beginner Unity gamemaking?

rich adder
#

get community 2022

#

those are old

#

update your visual studio installer its probably outdated

thorn lake
rich adder
rich adder
thorn lake
#

hmm weird

rich adder
#

bottom right what is the version on VS installer

thorn lake
#

oh weird, After closing it and reopening it it seems to have changed

rich adder
#

crazyy

thorn lake
rich adder
#

just like that

#

Community is the free version so get that one

thorn lake
#

thanks sm

rich adder
#

After you will need to hit modify and install the modules. Instructions are here

#

!vs

eternal falconBOT
#
Visual Studio guide

If your IDE is not underlining errors in red or autocompleting code,
please configure it using the link below:

Visual Studio (Installed via Unity Hub)
Visual Studio (Installed manually)

thorn lake
#

oh wait nvm, I was just reading the wrong sections of the webpage

#

Does coding a game in C# restrict what platforms it can be played on? I might've misunderstood someone a few days ago who made it sound that way

rich adder
#

unity has all platforms pretty much

thorn lake
#

"Navigate to the Common7/IDE directory inside your Visual Studio installation directory and select devenv.exe. "

I'm assuming this needs to be added as the External Script Editor rather than Visual Studio Code but I'm not seeing a "Common7/IDE" directory.

It says it is in the Visual Studio installation directory but I'm not seeing any sort of Visual Studio installation directory.

rich adder
#

if you're manually assigning exe you did something wrong

#

(make sure you did restart unity after you installed everything)

thorn lake
thorn lake
rich adder
#

nothing else is needed for unity

thorn lake
#

Could it have anything to do w/how I didn't set this portion up yet? (I wanted to ask for advise regarding which might be best practice for game creation out of these options before choosing one)

rich adder
thorn lake
#

Yeah, only seeing this option still

#

(just restarted everything)

rich adder
#

just make sure you do have visual studio editor in the package manager ?

#

doesn't hurt to restart whole pc at this point too lol

thorn lake
#

Could it be because the project existed before VS (purple) was installed?

#

Wondering if I should make a new project

rich adder
#

unity should still read a new editor installed

#

it did for me every time

rich adder
thorn lake
rich adder
#

rip

#

we're talking about the visual studio editorone or visual studio code editor

#

they have two different ones

thorn lake
#

woohoo!

rich adder
#

cool

#

now I would click Regen Project files just in case

thorn lake
thorn lake
rich adder
rich adder
#

cookin with gas

thorn lake
#

Maybe it was "Visual Studio Code Editor" that they were saying to uninstall

rich adder
#

probably

#

it conflicts with VSCode / Unity connection now since it no longer is being used for communicating the two programs

thorn lake
#

Thanks!

#

Earlier someone told me that I need to have a ".net SDK" to do any C# project. How do I make sure that I have that? (I'm assuming it's there by default with this purple VS

rich adder
#

Unity already comes with .net standard and i think another one bundled

#

you need the .net sdk if you ever want to make other apps instead of just unity

thorn lake
#

ah ok

rich adder
#

or use VSCode for unity

thorn lake
#

He must've been referring to VSCode bc hat's what I was using at the time

#

From what I've gathered, I should just stick to only VS (Purple)

rocky canyon
#

it was, thats what i thought u were using at the time

thorn lake
rocky canyon
#

purple ones better for beginners

rich adder
#

Yes on windows VS is the obvious better choice

#

vscode is catching up finally

rocky canyon
#

im hooked

thorn lake
#

I really dislike the naming convention for these two programs lol. The fact they're named so similarly made this beginning process so confusing haha

rich adder
#

but it is at the end of the day just a fancy browser

#

vs is a true IDE

rich adder
#

yeah microsoft really fdup this one

thorn lake
#

I'm surprised no one said "Wait a min" about that decision ngl

#

before it was finalized haha

rocky canyon
#

for the logo they just said, meh.. make it blue

rich adder
#

and its missing a piece cause its a not real ide xD

rocky canyon
#

thats why u run both

rich adder
#

VS always looks badass like a masked hero coder lol

rocky canyon
#

i need vscode for embedded programming..

#

so thats why i have 2

thorn lake
rocky canyon
#

aye! lol

rich adder
rocky canyon
#

the newer versions of unity handle both pretty well now

#

u can switch back and forth relatively easy

thorn lake
#

Are we all the same person?

#

Just different timelines ig

#

or universes or whatever

rich adder
#

I'm trying work on Timesplitters 5 rn

rocky canyon
#

soo u finally gonna get coding now that u have an ide set up?

thorn lake
#

Anyways, thanks guys. I feel like I've graduated from Unity coding infancyh into adolescence now.

rocky canyon
#

or are u still in the process 😅

thorn lake
rocky canyon
#

👍 nice... good luck 🍀

faint sluice
#

Hello, what's the proper way to implement "confirm quit popup" on pressing back button on Android?

#

I'm seeing suggestion to check for input in update but I'm not sure if that's best way to go about it since it's in update

charred spoke
#

Checking for user input in update is the preferred way to do it

worthy veldt
#

how do i access Sorting Group component through code ? there is no GetComponent <SortingGroup>()

worthy veldt
#

my god i thought i already implement UnityEngine.Rendering ma bad

fierce geode
#

Is there way to make variables collapsible in the Editor?

#

I have a lot of variables that aren't necessary sometimes; so it would just be clean if I could dollapse them to make things look tidier

eternal needle
# fierce geode Thanks!

are you asking about in unity editor which is what i thought or the IDE? for unity editor you'll either need to look into editor scripts like using EditorGUILayout.Foldout, or put the variables you want in a serializable class which should already have this dropdown looking button to expand it

fierce geode
#

working good so far 👍

eternal needle
#

the thing linked above would be for your IDE. The solution depends how you're using the variables. Like if these were public variables being used, and weren't neccessarily related to each other you wouldnt want to throw them in a class which would change how other things use it.
IIn which case you'd need a custom editor script

dry spruce
#

I have a problem