#how do i make an inventory system using visual scripting?

1 messages · Page 1 of 1 (latest)

foggy roost
#

how do i make an inventory system using visual scripting?

final fern
#

It's been a while since I upload an update to my game.

This has been such a journey and it's sooooooo much fun to have different drops. Now equipment shows as a bag item when dropped, display rarity color and have different base stats even if it doesn't have any special effects (higher/lower defense/magick def)

White (Normal), Blue (Magical),...

▶ Play video
foggy roost
#

ok lmk

foggy roost
#

i asked grok how to makeone, do u think it will work

light agate
#

what is an inventory but a list of stuff?

final fern
#

There's drag n drop logic, exchange logic, quantity (if any), item ID comparison... Slot data (equipments, items, bag, etc)

light agate
#

for sure. My method when approaching a new system will generally be to start at the very beginning

#

a definition for an item, and a container to put them in. Once you can successfully add and remove from that container, work on UI layout and interactions

#

you will begin to realize as you go what functions your container is missing

#

it helps if you know what you want your inventory system to do though

#

does it need tabs, context menus, drag interactions etc.

foggy roost
#

can i show you what I have, i ran out of grok messages for 20 hours

light agate
#

lol

#

no harm in sharing

foggy roost
#

thats all i have lol

#

im trying to pick up that object and when i walk over it I get that console error

light agate
#

looks like something that could work

#

the red error is telling you

#

its saying one of your nodes is missing a value it needs

#

and when you look at your graph it is highlighting yellow/orange to let you know

#

what question do you think you're asking with that if node? Like, if what exactly?

foggy roost
#

idk what to do with it

#

i only am trying to learn i have no idea really where to go generally

#

my grok history got deleted too so idk lmao

light agate
#

i susepct grok is not very good for UVS. I doubt you need the if node there

#

you're meant to put a predicate of some kind into the slot, currently that will always output false as a default

#

you'd normally be asking if x > y or i == 0, you know, checking for something. If you're not checking for anything just remove it

foggy roost
#

ok i got this error i deleted the if node

#

idk what it means to check for something or ask it a question im kind of learning right now lol

#

also idk if the immediate node was the right one, i changed that too

#

but it didnt work

light agate
#

that means you're trying to destroy an asset from your project, not an object in your scene

#

you must have dragged a file into the destroy node instead of a scene object

foggy roost
#

its a prefab

#

its not supposed to be a prefab? or

#

ok that makes sense

#

i cant type anything into the destory object node, i have to load it from the list. it had to be a prefab

light agate
#

ah that is DestroyImmediate, not Destroy

#

that's more intended for deleting files from your project... kinda, but you just want Destroy if it's for objects in your scene

final fern
#

Before you try to implement an inventory system - start with baby steps...

Like adding on player: on trigger enter item detected?, add to list and disable gameobject.

#

Add collider component to item and mark as isTrigger. Mark item layer as Item (or whatever)

Then in player add node:

onTriggerEnter and extract (drag from) the white paper output of this node, select node "get layer name" and compare using "equal item?" If true?

Add item to list.
Disable item.

foggy roost
#

oh ok i think i know what ur saying

#

this is like my 10th time trying this and that i can conceptulize well ill try it later

foggy roost
#

hahaha

#

i put this in my player movement scirpt

#

i added the Item layer to my object and its coliders trigger is active

light agate
#

u wanna heed your yellow warnings

#

all your nodes that have lit up yellow/orange

#

they are telling you to fix some things

foggy roost
#

I couldn’t find the set layer node I think

final fern
final fern
#

Here's what you can do to get the layer of the object, it's not the ideal, but it works. it says Player when my collider of the player enters this item range

foggy roost
#

i dont see human naming

#

i also was wondering if my rigid body was not on my player 3 script if that was bad but its a child on the body part in the screene shot

#

my player script is just on an empty parent of the body

#

also i changed the layer to Player

#

and than i copied it, now Idk what to do

foggy roost
#

lets see

#

i would need to set the layers on my pickup object

#

and than put code on player object to disapeear when my player object colides with it and than goes into a list

#

thats the jist?

final fern
#

Your player needs rigidbody

#

And the item to pickup, collider isTrigger

final fern
foggy roost
#

theres more code though right, we still have to destroy the object

#

and is the code I have right now, does it add it to the list or what, and what is the list

foggy roost
#

why does my code just say layer

#

dont i have to set it to a specific layer

final fern
foggy roost
#

Player

#

this means something also right

#

i put my pickup object layer as Item

#

so do they have to be the same

final fern
#

Share inspector screenshot or record a video showing around

foggy roost
#

and heres the pickup

light agate
# foggy roost

layer's are basically numbers under the hood, but you arent actually setting anything to any layer there

foggy roost
#

oh lmao

#

i tohught they were like a tag

final fern
# foggy roost

In this case, i see you are getting layer of the item. Because this script is in the player.

#

So check the inspector the item what layer it has - should say Item as your lasts screenie

light agate
#

you are taking your collider, getting your layer mask as a number, and then converting that number to a string, then logging that string

final fern
light agate
#

you can wrongly use layers as tags, and its not necessarily harmful, just not the intended use

foggy roost
#

ok so why are we logging it

#

dont we have to do stuff with it first

#

like we get the string than it puts it somewhere

#

to the inventory

light agate
#

tags are easy groups to use in code

layers actually have functional impacts, like whether collisions will work between layer x or y, or whether your camera can see objects on that layer

foggy roost
#

wait are we getting the pickup items layter

#

layer

light agate
#

not sure, all i know is you're logging that collider's layer's name

final fern
#

In this case yeah, because that script is in the player. So that white paper from OnTriggerEnter is getting info from the Item.

But... Player have any collider marked as "isTrigger"?

#

It only has a rigidbody. Not a collider

foggy roost
#

oh ok the body had a collider but not the player my bad

#

im just dumb

final fern
#

Rigidbody gives access to be affected by physics, such as gravity.

Collider gives data to bump with other objects (or be detected when in range)

final fern
foggy roost
#

i was thinknig like

#

see its in body

#

i added it

#

i tested it

final fern
#

Now you have successfully done the first part of getting items - which is item detection 🙏🏻

foggy roost
#

hell yeah

#

the console logged it as soon as i logged in without walking over it

#

but all good

final fern
#

When you say "as soon as i logged" - clicking on play mode?

Maybe because it's on top of the other instead of "walking" to it?

#

Now the next step is to add the logic when player gets on its zone. You want to disable the item.

So use "gameobject active set" and make sure it has unchecked the box in that node

And from the "onTriggerEnter" white paper output drag and search a node "game game obj" it will give you get the gameobject and plug that into the "this" of the disable gameObject

foggy roost
#

i couldnt find game object active set and i think ur phone auto correct game game obj

final fern
#

I literally type "game game obj" to get that specific node

#

try it and see

#

it says something gameObject.gameObject(get) 😒 confusing, i know, but it does what you need to target the right object

foggy roost
#

any of these?

#

think that could be it

#

this is wut i configured lmao

final fern
#

im opening my project, let me show u

#

you DONT have to type all, to find the node you want.

#

you can even add that star, in case you want quick access. but its faster to type like that

foggy roost
#

wdym by dont have to type all

#

oh

#

its cuz i wasnt doing it out of the colider

#

lmao i see

#

would i continue it off like the same collider

final fern
#

that's what i meant when i said "drag from the white paper" lol i dont know why it has that paper

foggy roost
#

like one that sets the value for the inventory, 1 that makes it disapear

final fern
#

now that you have that rference to the gameObject, connect it to the set active false

foggy roost
#

sorry i got lost with what you said earlier

final fern
foggy roost
#

oh white paper as in the later mask?

#

layermask node icon*

#

and i ticked it active

final fern
#

Like this

foggy roost
#

k ill copy it ty

final fern
#

you change the STring Player for whatever

#

In this case i think it should be Item

#

if you want to detect if the thing netering your isTrigger ocllider is a Item

#

then vanish it

foggy roost
#

sry i got this error i think its from my player movement script

#

im trying to figure it out

#

i didnt even change anything lmao 1 sec

#

this is my other movement code btw on the same visual graph idk if it might interfear

final fern
#

where is the red node? dont quit play mode yet - you can check the script on the go. you can pause, and hide the blackboard wit hvariables to speed it up if it needs to

#

clicking the console error sometimes sends you to the object containing the error

#

and add this addon made by X7 to find the red nodes when they show up. It's a nice debugging tool to have.

Just drop it in your project files in Unity editor

foggy roost
#

it brings me here when i click on the error

final fern
foggy roost
#

sorry i dont see any nodes that are yellow or red

foggy roost
#

i moved it to a scene with a different player movement script and it worked

#

the only thing is when I set a trigger to a box colider on my guy he goes threw the floor now lol

#

when I make the box collider a trigger I mean

#

idk this is the code for it

light agate
#

we need to see screenshots of them in-action so we can see what values you're passing and what might be breaking

final fern
#

Do you know how to record screen? There's a free app ShareX you can use

final fern
final fern
final fern
light agate
#

u can Win+Shift+S, windows has a native screen-recorder

#

i really need to learn the new input system sometime

final fern
#

It is really easy, in fact some of them work as events (instead of using onUpdates and if true checks)

foggy roost
#

the game Is not a genre though. but the tutorial was a block that went foward so i made it into a racecar

#

maybe a bunch of different games

#

it has a physics material on the racecar i forgot what that does maybe

foggy roost
#

I want to make it like though You beat single player, you get duo player, triple player, quad player and than its like a mmo after that and than create BTC for items

#

i think thatd bee sick, the value stays with the player but Im mostly just trying to make a single player obviuouslly but thats what i want to do

#

like one day when i have 500 trillion dollars

#

omg

#

i make the currency a fucking cyrptocurrency

#

im cooking

foggy roost
#

also if u have like a simple player script i can copy and duplicate the scene or something it might be easier

final fern
#

Its best if you learn how to draw than cloning

#

Assuming you dont know c#, the hardest part is knowing what nodes exist and what methods can be used to add logic working.

Because there's many ways to control a player. And some might seem the best and maybe not

foggy roost
#

ok can you teach me than

#

🙂

#

i can try and make it first right now

#

ok i got it, i deleted the head and all the nodes in my last player script and now its ok

#

Sorry its all over the place xd

#

so now I need to destroy the object when I pick it up

#

im trying to understand the code though

#

like can you just explain the layers again, are we converting it from an int to a string just to read it?

final fern
# foggy roost

dont use deactivate node then, and plug that entry to the destroy object

final fern
# foggy roost

click on play mode, and get these nodes activate (they turn blue) when it triggers. so when it does, there's going to be here some words... show us what does it say

foggy roost
#

am i dumb

foggy roost
#

shouldnt the layer be Item instead of player i feel like thats why im most confused

#

like if im colloding with a item, why would i name it player in the layer

#

like should i name it layer or does it need to be player layer and the item layer is something else

final fern
#

If the onTriggerEnter is in the player, player wont need to detect himself.
Would it?

So what is entering player's range?

Thats where you compare.

Is it item? Is it enemy? Is it spikes? Is it lava?

foggy roost
#

are you making an aillien game like destory all humans

#

that game was goated i dont even remember anything but it being great lol

final fern
foggy roost
#

hahaha

foggy roost
#

so what do i do now

final fern
#

Think.

#

IF it's ITEM, then change that string

#

play game and keep this script graph window open, when you get near the ITEM, see what string appears there

foggy roost
#

i showed u tho when i click play it disappears

#

idk how to keep the graph open when i click play

#

ok ill try to change the string from Player to Item than set the layer on my pickup objet as Item

#

i was confused the whole time about that

#

i am confused on why though its like set to the false section of the if statement im not sure if its cuz i dont understand the future code or what

#

but it will look better to me in the future i bet

final fern
#

you only want the flow to move forward from that IF - ONLY when it is the exact layer you want to detect, in this case: Item

foggy roost
#

Omg it actually worked

#

the item disappeared cuz i named the layer Item

#

brb

foggy roost
#

ok so set active to false after the if statement at the end makes the object disappear because its false right?

final fern
#

Yeah

#

When you select an object in the hierarchy, you can use keyboard:

alt+shift+A and you get the same result. You switch it off.

#

And when you see inspector, that checkbox at the top gets unchecked. (The one that can be clicked)

That "check" is the same you see in the node, in your graph

foggy roost
#

Coo

#

so whats the next step, its in a list and it disappears, should i make the ui now

final fern
#

You added item to a list?

#

It depends on what you want to do with that item. If its only display what's in the inventory, then you need UI + Grid layout + sprite holders

#

And make a gameobject variables for each item that carries its own sprite, text details, etc

In my case, i used an AOT Dictionary for each item slot inside the UI inventory

So it carry info for that slot:

itemSlot (what position in the inventory it occupies)
itemName (to display HuD)
itemType (weapon? potion?)
itemQuantity
itemSprite (to show image in the inventory)

So every slot inside that grid have this variable.

#

Say you pick up item. That item have this same dictionary.

When its picked up, you copy this variable data to slot data.

And thats it

foggy roost
#

that makes alot of sense, i did the exact same thing in a tutorial but the other half needed visual scripting plus so i couldnt finish it, nor did i understand the code at all

#

where do i put the grid layout component, i make a canvas right

final fern
#

I got that uVS plus thing - when i started 1 year ago, its not good. Pure subgraphs and sometimes you dont even know how it works.

As i said, logic > flows > nodes

You cant learn via templates

foggy roost
#

true

final fern
#

So you define the size of your inventory grid in there. 3x3, 5x3, 5x5 - w/e

foggy roost
#

yeah and the child is just an image right

final fern
#

Its a prefab duplicated for each inventory slot.

You edit one, they all copy the original (like adding a new key+value for the dictionary)

#

Or adding a background sprite for the item sprite

#

Here's when i think "prefab variants" works best.

But i have yet mastered that 🤪

foggy roost
#

and than ill drag it into as a prefab

final fern
#

Type in there:

"AOT dic"

#

You'll get a dictionary type of variables. And have all item data in one variable easy to clone between dropped item and item in inventory

#

An AOT dictionary will show 2 blocks of variables. Keys + Value.

Key once saved cannot be changed or reorder

#

"ItemData"
Variable AOT Dictionary

Name | Small Health Potion
Qty | 1
Type | Potion
Sprite | Image

And you can choose what type of variable each key and value needs.

I usually use string for keys. And then change value type for whats needed

#

Qty uses INT

String | INT

Sprite needs an image sprite

String | Sprite

#

Play around with it you'll see how it works.

When you pick item, (the graph you already have - right after disabling item) you trigger custom event "itemPickedUp" and send 1 argument with it ("This" node. It sends the item gameObject).

The inventory script receives this custom event and use a node "for each loop" (dictionary checked box)

Get the argument 0 from that event, and connect a node "get variable: itemData" and connect that to "for each dictionary" node input

Then the inventory, who has a list of all slot prefabs, does a check which is empty, and use that slot.

"Set item dictionary" and connect key to key, value to value. Voila.

foggy roost
#

you said for the type variable it matters like more on the mechanic of them item?

#

also what do i do with the aotc dict

#

for item name

final fern
foggy roost
#

kk

foggy roost
#

this is what i tried to do, I put all the variables on the Itemslot prefabs, the pickup item and the player object

final fern
#

Thats going to give you error

#

Cause you are going back n forth with set variable outputs

foggy roost
#

oh wait like this?

#

or something

light agate
#

I wish UVS had a fnCall that wasn't a catch-all event broadcast

final fern
foggy roost
#

what's the difference between keys and value in aot dictionary are they for variables like keys is for the name and value is for the string? or something

#

like i dont understand aot dictonarys purpous

light agate
# final fern what do you mean?

in code you just call a function directly, in UVS you have to broadcast an event. In practice this is a tad spray-and-pray. It broadcasts an event and any number of listeners catch and determine if it was meant for them. It's needlessly expensive

foggy roost
#

whats an event

final fern
#

and then, there are conditions which lead to consequences

#

event > condition > reaction

#

Damage > Hp = 0? > Die.

foggy roost
#

oh

#

i dont get if im supposed to have the item variables on my player, my pick up item and my prefav for the inventory slots

#

was my main question honestly

#

also is it fine that the box connecting my item variable is from the get gameobject before the object disappears

final fern
#

You could use app variables as well, there's many ways to do it

#

The important thing afterwards is the ability to "save" and load. And thats tricky. To get there, it helps to get these basic data transfer between objects

foggy roost
#

ok im stuck

#

what are app variables like global varaibles idk

foggy roost
#

and what do i do with my code

#

idk im stuck with that

#

i dont even know what i coded lol

final fern
#

Make sense of it before you continue

final fern
heavy ravine
final fern
#

For example, i use this:

EnemyBaseStats.

That's the atm variable name.

It has these keys, and value of each separated by |

Hp | 10
Damage | 3
Speed | 5

So lets say they "rush" so i set their speed x2 , and then reset back to their default.

Get dictionary item, key Speed = output will be 5.

I get stats from a dictionary and save them locally as graph variables.

I need to modify all enemies stats?

I dont do it one by one, i change this dictionary - and they reupdate it on their own graph variable on event (update stats, on enable, on respawn, etc)

foggy roost
#

so now I need to put my variables in my item slots in my inventory right? and than its done?

#

for my hud

final fern
#

And there's an additional feature you have yet asked. I assume you know how?

Getting mouse events.

On enter, exit, hover, drag drop.

#

With that you can move things around or delete one of them or use/equip it

foggy roost
#

i know nothing

#

i was just farmillar with the parts we are doing but i couldnt replicate it or do it on my own

#

i was just saying i understood wut u wuz sayin a bit

#

once I get the inventory system though Ill try and do some stuff on my own

final fern
#

Well, i nerded this for 3 weeks, 8 hours a day and stumbled many saying its easier on c# and not really doable in uVS 🤷🏻

#

Back then it felt impossible

#

But you can cross that barrier and do it

foggy roost
#

it seems really easty

#

easy

#

honestly i am learning where on c# i wasnt learning

final fern
#

Best tip i can give you: think of the game logic before you code

foggy roost
#

so if my itemslot is a preefab, i need the variables to show up in the prefab right, the hud

final fern
foggy roost
#

i dont learn from tutorials

#

im too high

#

too braindead

final fern
foggy roost
#

can i skip the dictonary though

final fern
# foggy roost i dont learn from tutorials

You won't learn from tutorials, i tried. Most are c# experts trying to explain as if you already know a thing about it

And since i know like 0 c#... I didn't understand lol

foggy roost
#

is it just to make it easier or more convienet

final fern
foggy roost
#

ok cuz i have no idea how to use it lol

final fern
#

Haha I'll make a video on monday showing you how they work, i like them a lot. Very useful

#

Your UI only displays 2 things: the sprite and the description (quantity, name of item, etc)

#

The itemSlot is responsible to put it where it renders, so that's semi automatic

final fern
#

Again, i took codeMonkeys uVS course. Udemy gameDev uVS course. They explained pretty basic things

Tried to see a full c# course in YT .. and didnt get a thing 🫪

#

But!

#

I learned to use Gemini (google AI) to find what nodes i need. You know, the thing you type in the fuzzy finder.

Once i understood the game logic, not the programming code, i came up with "problem solving" process that allowed me to build an inventory my way (including save load system) which im sharing with you

#

Cause my #1 problem was.. like...

Ok i want to do this. It works like this.

But how do i get that running?

What is the "function" or the "keyword" to connect events with presents?

foggy roost
#

brb

final fern
#

The rest is kind of learning Unity, how it works as a platform and their lingo

foggy roost
#

why does the string say itemPickedup on it

final fern
#

You mean the trigger custom event?

#

Have you used them before?

#

My favorite node. Once i got how they work - oof made things easier

#

https://youtu.be/iHtaIMx7Kfw?si=ayU12jBjXdW4E5oW

I made this video last year hoping it helps anyone looking for it

The less onUpdates you have - the better your graph codes will perform.

And one way to connect one gameObject with another, send information from one script to another... is to use Custom Events.

So far - this is the best nodes I've ever learned to use in uVS. Now if you didn't know how to use them - this video will show you how they work.

...

▶ Play video
foggy roost
#

ok this is what i cooked

foggy roost
#

i probally shouldve tested it, i assumed it was wrong and forgot

final fern
# foggy roost

Hmm if you could explain this logic, what is this supposed to do?

foggy roost
#

i tried this instead

#

i think custom event arugments changes the varriables of a game object from the object being picked up and than i tried making it set in my item slot prefab but it didnt work

final fern
#

Did you see that video i shared?

foggy roost
#

yeah its just my brain dosent work so i have to rewatch it

final fern
#

Its because you need to experiment with those and test, thats when you learn

#

Doing. Doing. Doing.

light agate
#

Yep. Can be more effective than tutorials, often

final fern
foggy roost
#

oh is custom events just a number of how many times an action is performed

#

so itd occur 3 times in my code

#

thats what i orginally thought it was

#

oh also

#

do i want the varriables to be from my item slot, not my pickup object

#

i lose track sometimes of the objective honestly xd

final fern
foggy roost
#

yeah exactly, than im trying to get those values to be put into my item slot

#

lets see

#

i want to put those variables into my itemslot variables

#

of them item i pick up

#

idk how to like set them though

#

and i probaly dont understand custom triggers somehow lmao

final fern
#

Complete the list!

final fern
#

Keep going!

light agate
#

yep, time to grab your pen and paper WoW (or keyboard). Write down the steps you think your inventory system takes, show that to us and maybe we can grill it

#

Litoid just gave you an example, but you need to fill out the numbered list of steps yourself. For your case in particular, because it isn't just UVS you're trying to understand here, but programming instructions in general. You will be able to guess your way through a system, or google what's available, once you can clearly state what your system needs to do, step-by-step

final fern
#

Exactly. game logic flow > coding program mechanics

foggy roost
#

can you tell me what my codes saying right now tho at least

#

just so i can learn and change it

#

i dont really get custom event trigger argument

#

i need something to change the variables or set them

final fern
#

when item enters player's zone (thats true?) then deactivate that item (make it disappear). then send it's quantity, name and sprite to this event, and the object listening to this event is the same item gameObject (the cube input) and then save itemSlot as the empty variable

#

this is what it says

#

when item enters player's zone (thats true?) then deactivate that item (make it disappear). then send it's quantity, name and sprite to this event to player's inventory (connect player's inventory gameObject to that)

And then the rest should continue after the custom event is called

#

think of custom events like a portal.

Trigger Custom Event is the entrance (where it goes through), and Custom Event is the exit (where it lands)

the string you put in that empty textbox - is the "ID" for this custom event, and the gameObject input port is "who in the hierarchy will receive this event"

foggy roost
#

thanks

foggy roost
#

ok im watching ur video with my brain more turned on and its actually clear said

#

my bad

#

im just afraid of coding tbh

#

i got this error

#

when i dissconnect that thing it turns orange

#

so like thats why theres so many itemslot refrences, im actually not sure the best place to put the refrence in the code

#

but did i do anything right?

#

and heere is my pickup item variables

#

sorry, i didnt show that earlier probally its hard to follow cuz im dumb

#

i feel like im close now 🙂

#

ok i fixed the error

#

i think

#

but my item sprite didnt update in my itemslot

#

nah i def dont understand it lmao i just gota watch the video again until i get it

#

probaly

#

xd

foggy roost
#

also im trying to get the object variables of the pick up object and "this" only gives me object variables from the player object you know what i mean

#

idk how to get the variables object from whatever im picking up

#

like if i save it to scene or app than its not going to be unique to whatever item i pick up

#

nvm i think i just keep forgetting what things mean

final fern
#

But it doesnt have to be in the same script, add another gsmeObject in hierarchy and sdd new script machine (playerInventory) or something

And there you put this custom event (the one on the right eith saving variables (the set nodes)

#

This gameObject is parent of maaaany itemSlots.

Inventory
itemSlot 1
itemSlot 2
itemSlot 3

And so on.

And in your player, add "object variable" type gameObjecy and drag this "Inventory" gameObject there

And this variable you connect to the "trigger custom event" gameobject input

This way the Inventory's scriptmachine will listen to this event

And then be able to catch these variables

Try that before updating the sprite. To actually save data to the itemSlot

foggy roost
#

i tried getting the items name but it didnt work

light agate
#

@final fern What happens when you provide an input to a get-variable node like in his first image?

#

I never understood why get-variable nodes had inputs, they just output whatever value the variable is set at in the graph, object or scene

final fern
#

the orange dots are string type inputs, if you dont connect anything it uses the value you write down, in this case "itemName".

the cube type is gameObject. if you dont connect anything, it uses the gameObject where this script is attached (i.e. the Player). If you connect, say inventoryManager variable into this, then this "get variable" will get itemName variable FROM the inventoryManager variables, and not the player.

final fern
# foggy roost

Remove that, let it be "This" by default. you are "listening" to a event in a gameObject not present

foggy roost
#

oh it worked i think

#

its for all of them but yay

#

oh idk if it worked it was fire already lmao

light agate
#

ok i see, so object getVariable nodes in particular can take other inputs.

#

If you provide a GameObject, does it sample the Variables component on the chosen GO?

foggy roost
#

oh i didnt even see u were talking to him before that

#

im so dumb

final fern
final fern
#

this is how different gameObjects uses their "public" variables that in uVS is called "Object Variables" - can be seen, and modified by other scripts (gameObjects)

foggy roost
#

i give up

#

i deleted unity

#

i dont want to be a coder lol

#

I just need ai to be better

final fern
#

🫪

#

He tried to do something advanced for someone who doesnt have experience

#

Thats a surefire way to burn yourself out

#

One point for my curriculum:

Dont start building systems, level up by making steps.

light agate
#

I don't mean any shade to WoW, but I bet it will become more and more common for people to endeavour into programming tasks with the expectation it should be straightforward. There will be less tolerance for the friction presented as programming's participants become more and more general-audience. People are vibe-coding web-apps because AI is quite reliable with more ubiquitous and universal text-based stacks. like HTML/CSS/JS and or Python and any of the tools that can simply be tacked on by editing a text file. Needing to understand Unity Editor, all the menus and windows, to even know what to do with the code AI gives you will start to be seen by many as quite a barrier.

Unity have already been evolving in light of this for a few years now, with latest Unity 6 having integrated/on-board MCP/AI. People can almost reasonably expect to tell it "Make a platformer where I can pick up items, then inventory should be like Baldur's Gate but the gameplay should be like Astrobot".

A Regan of the 1970s might never have picked up programming, it's only thanks to more modern conveniences that with my poor logic and maths skills I was still able to make a start and 15 years later am finally a tad competent. But if I started with how programming used to be, I might have had no shot. I'm a competent programmer by modern standards, but probably a pretty incompetent one by 1970 standards.

#

Still, I think the best approach to understand is not to dive headfirst with AI. It's great but you can get led astray if you're not asking it the right questions, the kinds of questions you can only ask when you already know a little about the topic.

I know when I was learning I read lots and lots of forums, and EVERY time I came across a term I didn't understand, even "what is a variable?", "what is a const?", "what is a method?", "what is return?", "what is ternary?", I would google and read official unity docs, microsoft docs, forums. And in some cases, like when realizing Quaternion seems more relied upon in game-dev than Euler for rotation, putting in the effort to read a full wiki page on just that topic, as well as additional resources.

#

I really believe anything is possible, and anyone can do it, but reading is important. Unless willing to read documentation and full forum posts and articles, I don't think you can get far. I have taught at tertiary level before, and just that willingness to read has been a noticeably HUGE difference between the students that not only pass but SOAR, and those who fail or get just past the 50% grade-check.

final fern
# light agate Still, I think the best approach to understand is not to dive headfirst with AI....

This is an interesting comment you share, thanks for that. I hope more people persist during a struggle phase - cause that's when we usually grow, but most people are not "trained" for consistency. I remember when i wanted to quit when things were not clicking on me, i had a very bad days back then - but i was stubborn, and now im here - still on my journey.

And I agree: Self education is and will always be the best way to learn.

Not hoping someone to take our hands and walk with us, but the willpower to research by ourselves.

But here's where I disagree.

Reading may be good, and i love it - and because i do, is the reason i'll say this:

Knowledge without action will never turn into wisdom.

Reading is just knowledge.

Its good to break the system, get bugs and crash the editor - this is how we learn long term 🤪

light agate
#

oh yeah absolutely

#

we learn a lot just by trying, it's not all reading

#

but when someone asks me about an object pooling system but then DOESN'T read the object-pooling article I send them because they don't like reading, I mean.... I've provided the info lol

#

But i get that sometimes people can reach the profound conclusion through a more practical avenue

#

for example, you sometimes have been using a technique that just made sense to you personally, for months, years, and to later encounter someone talking about it, and discovering it's a well-known pattern/approach and even has a name, and people sometimes go out of their way to learn this pattern, but you've been using it all along by accident.

final fern
#

I kind of like thinking why people dont like to read...

uVS users or regular c# ?

final fern
light agate
#

but, actually the context i was recalling was C# users, not UVS

#

I can definitely imagine why someone would go "no, I'm not reading that", but we're lucky there is pretty much a youtube video for everything now

mossy nimbus
light agate
#

only if stuck really, or if the task is so straightforward that it'd just be a chore for a human to do

#

lot of us use it but it all has to get reviewed by humans anyways. Accountability is important, so it is fine for devs to use it but they also need to be able to explain how the code works later

#

good for first-pass

final fern
# light agate but for interest's sake, the catlike coding one on that topic is pretty lit htt...

I saw this one when i investigated object pooling and understood almost nothing lol

I cant read text firewalls, c# distorts my view :/

I think these type of articles would benefit from visual analogies. Now that i know what is object pooling and actively using it - I imagine computers doing this:

No object pooling:

  1. right click, create new file
  2. Right click, delete file
  3. empty trashcan

Object pooling:

  1. generate 20 files at once
  2. drag from folder to root to display
  3. drag to folder again to hide
#

But thats just me and how i process data 🤷🏻