#stupid class for stupid people (kayla

1 messages · Page 1 of 1 (latest)

normal nest
#

okay i was gonna ask earlier

#

the sprite ive made to replace the other object

#

if i hide it using this will it be visible when replacing the object?

#

or still be hidden

#

i dont want it to be in the way so i wanna hide it

hollow pilot
#

if you disable the gameobject, its disabled

normal nest
#

oh thats a disable

terse slate
#

well if you "hide" it, it will be disabled

normal nest
#

i thought it was just a hide button

#

where can i hide sprites

#

wait

faint valve
#

kayla please look at the tutorials i beg

#

even if not to check programming

hollow pilot
faint valve
#

just to see what buttons do

normal nest
#

theres no harm in just seeing for myself!!

#

ive put the sprite in the errm

#

assets folder thing

#

at the bottom

#

i assume i can call it from there

terse slate
#

i would definitely learn the layout of unity, pressing random buttons can lead to bad things

hollow pilot
normal nest
#

im not pressing random buttons

#

is there a noticeable difference from using

#

serializefield with private variables

#

or just using public variables

terse slate
#

yes

normal nest
#

i tried googling this before but nothing was really showing up

#

whats the difference

hollow pilot
normal nest
#

i know

#

im asking

#

private vs public

terse slate
#

serializing a private variable will make it visible in inspector but not visible to other scripts

#

while public does both

normal nest
#

so if i make a public variable i can reference it in another script

terse slate
#

thats what public does

#

use the documentation to figure this out

normal nest
#

ive been wondering that for ages

#

and no because now i know the information

#

while using it at the same time

#

rather than combing through documents and videos which you can barely rely on for specific questions

faint valve
#

the videos specifically explain how the commands work

terse slate
#

documentation literally tells you your own answer

#

very quickly

normal nest
#

this works just the same to me

terse slate
#

same with videos

normal nest
#

with the advantage of answering more specific questions

faint valve
#

you dont know if its a specific question or not because you dont understand what the thing is

#

like when you asked about the disable game object button

normal nest
#

im not talking about buttons

faint valve
#

where is my angry old guy cloud thing

normal nest
#

i have specific questions all the time

#

actually i have another question right now notlikethis

#

it looks like i need a void ChangeSprite() to use the sprite changing code

#

but i wanna use it inside of a void OnTriggerEnter()

#

what do i do here

hollow pilot
#

just do .sprite = newSprite

normal nest
#

websites lying to me again

#

hold on that doesnt work

#

did you mean something other than .sprite

hollow pilot
#

but you can check the docs

#

should be that

normal nest
hollow pilot
#

on a reference to your sprite renderer...

normal nest
#

fuck are you talking about,,,,

faint valve
#

🗿

#

good luck kayla

normal nest
#

im slow either way

#

i 100% gauruntee you even if i read every document in the world

#

id ask stupid questions

#

im just not a bright gal

normal nest
terse slate
normal nest
#

this makes zero sense to me

#

just give me an example ill figure it out from that

hollow pilot
#

but now your doing sprite

#

on a SPRITE RENDERER

terse slate
#

SpriteRend.sprite //this is a reference = mysprite;

normal nest
#

spriterend doesnt exist

hollow pilot
#

use

#

your

#

🧠

normal nest
#

IM TRYING I DONT KNOW WHAT YOU WANT ME TO DO SOB SOB

#

im autistic just give me the answer

#

thats been working so far

#

ill like reverse technology it

terse slate
#

im not just gonna give you the answer or else you wont learn?

normal nest
#

the whole point is ill learn from the answer

terse slate
#

we have to teach you

hollow pilot
#

with the rigidbody

#

renderer

#

same thing with the sprite renderer now

normal nest
#

all i remember from that was just

#

normalize

#

do i normalize,,?

hollow pilot
#

or change the color

#

you now change the sprite...

#

its not that complicated

normal nest
#

thats literally

#

what im trying to do

#

i dont know the exact code needed

terse slate
#

when you did .normalize that right there is a reference

normal nest
#

im like

#

90% of the way there

#

i dont know

#

precisely

#

what im meant to put there

#

tell me so i know for the future

#

oh wait i missed out something

hollow pilot
#

the reference to the sprite renderer

#

you can use .sprite on nothing

normal nest
#

it was not the thing you think im thinking of

hollow pilot
normal nest
#

od you mean in the inspector

#

i already know im supposed to do in the inspector

#

thats the easy bit

#

i wanna get rid of the error line here

hollow pilot
normal nest
#

i want to fix this bit

hollow pilot
#

to your sprite renderer

#

you cant use .sprite on nothing

normal nest
#

im supposed to do the inspector thing now?

hollow pilot
#
private SomeVariableType variableName;

variableName.Something = 5;
variableName.DoSomething();
//"variableName" is your reference
normal nest
#

its not showing up

#

ujghggghh im sorry i dont get it

hollow pilot
normal nest
#

thats what im

#

trying to fix

#

i dont get what you mean by reference

hollow pilot
#

and analyze

#

to what im saying

normal nest
#

i dont understand that

#

im trying to

hollow pilot
#

i tell you what a reference is

normal nest
#

i am

#

i dont get how to

#

incorporate that

#

into mine

hollow pilot
#

private SpriteRenderer sr
sr.sprite

#

whats so hard about that

#

please tell me

normal nest
#

sr?

hollow pilot
#

variable name........

normal nest
#

oh i was misusing a capital

#

the way you worded it makes it sound really complicated

#

references

#

just goes in one ear and out the other for some reason

#

i get what you mean now

hollow pilot
#

i could have a fully working multiplayer game by the time you learn basic C# and Unity code 🤦‍♂️

normal nest
#

woah thats so weird maybe its because im a beginner and youre not

hollow pilot
#

ive barely touched Unity in the past 3 years

normal nest
#

you clearly know miles more than me

terse slate
#

he retained the information

normal nest
#

exactly,,?

#

okay wait i cant put my sprite in the slot

#

probably because its a 'prefab asset'

#

how do i make it go in there

hollow pilot
#

what even is it

#

what did you drag into assets

#

a .png?

normal nest
#

2d object

#

its a 2d object with a child

hollow pilot
#

so thats not a sprite

#

thats a GameObject

#

you cannot change the sprite

normal nest
#

aaagh annoying

hollow pilot
#

or just have an actual sprite

normal nest
#

how do i get around this

hollow pilot
#

and drag it in

normal nest
#

like turn it into one

hollow pilot
#

idk why you have a prefab of a GameObject

normal nest
#

i thought since it yknow

#

has like

#

image properties

#

it would count

#

i dont see why it shouldnt

#

worked for other ones

#

how do i turn it into a sprite

hollow pilot
#

why are you turning anything into a sprite

#

do you have a png?

#

your image

#

that you want to use?

normal nest
#

i dont know

#

i made it out of gameobjects

#

and because i want

#

this gameobject

#

to be used a sprite

#

its just the box with a white outline

hollow pilot
#

so what you wanna do here is just completely changeout the entire GameObject not the sprite?

normal nest
#

huh

hollow pilot
#

well since you dont have a sprite

#

changing a sprite of the SpriteRenderer isnt possible

normal nest
#

is there seriously no way to just get the image that the gameobject uses and use it as a sprite

#

that sounds so stupid sob

hollow pilot
#

what image

#

how does that sound stupid

#

if your "image" is multiple game objects

#

then thats your fault

normal nest
#

it can literally just take the image of it

#

and ignore the gameobject stuff

#

and because i didnt want to open up an art program to put an outline on something

hollow pilot
#

first of all i have no clue, not a bit of information of what it ACTUALLY is

#

you havent shown me a single screenshot

normal nest
#

this is it

#

i thought i did

hollow pilot
#

what is this made of

normal nest
#

two squares

hollow pilot
#

i guess what you could do is

#
player (parent)
     Sprite1 (child)
     Sprite2 (child)

(in your hierarchy)
and just enable/disable the GameObject that you need

normal nest
#

it has nothing to do with the player

#

this is that 'table' ive been working on

#

its meant to show the outline when you get close

hollow pilot
#

ok doesnt matter, same principle

normal nest
#

its actually annoying me that they cant just take the png that is literally stored of the gameobjects and just use that is it really that hard

#

am i geeked

hollow pilot
#

its 2 sprites rendered by 2 different SpriteRenderers

normal nest
#

surely theres a way to just take the image of whats shown on screen and use that

hollow pilot
#

that doesnt even make sense

hollow pilot
#

or make some actual art

#

and swap the sprite

normal nest
#

i dont really get it

#

do i like

#

put the outline bit

#

as a child

#

on the regular box

#

'table'

hollow pilot
#

make the outline one and the not outline one both childs

normal nest
#

and enable disable it

hollow pilot
#

make the parent have NO sprite renderers

#

make it just have Rigidbody, Colliders, etc.

normal nest
#

i mean the

#

non outline one

#

is literally an exact copy of the parent

#

whats the point of that

hollow pilot
#

because its a visual

#

which you might scale

#

it should be a child

#

the parent should only hold the Key components.
rigidbody, colliders, scripts

hollow pilot
normal nest
#

well no because

#

it needs the script

#

to change colours

hollow pilot
#

the children dont need that

normal nest
#

if i remove that script it wont be the right colours

hollow pilot
#

parent has the script with collider and rigidbody

#

the 2 children are VISUALS ONLY with a SpriteRenderer

normal nest
#

think i got it

#

i need the code to like

#

make the outline appear

#

and dissapear

#

thats the entire point of this

#

you wanted me to uhh

#

disable it right

hollow pilot
#

yes, which you do by activating and disabling the GameObject's (the children)

normal nest
#

and enable it

#

yeah

#

waaait

#

if i disable both of them itll just be blank

#

do you mean just the one

hollow pilot
#

yes you disable only one

#

and keep the other

normal nest
#

i cant find anything on google that has a good example of what i code here

#

i hate the 'examples' that are just snippits of someone elses code with random bits of other stuff in it

#

i dont know whats needed or not

#

can you show me what i need to code here

hollow pilot
#

you dont need a single example

#

.SetActive(true or false) is what you write

normal nest
#

zero context but ill try

hollow pilot
#

ok let me explain this

normal nest
#

wouldnt i need to add the name of the thing i want to disable

hollow pilot
#

in the documentation it would be

#

GameObject.SetActive(bool)

hollow pilot
#

this same principle applies to any other piece of code in the documentation

normal nest
#

thats all i needed to hear

#

grin

#

should work

#

unity is being stupid and making the outline look uneven

#

it works perfectly fine

#

i aligned it perfectly fine

#

but its making it look lopsided and its really annoying

hollow pilot
#

thats probably just because they are overlapping and does some weird stuff i guess

#

thats why it would be easier to just make a sprite or the shader

#

but this will work fine for now

normal nest
#

this is only a test anyway

#

ill probably sleep and adapt this into a new save with actual sprites