#stupid class for stupid people (kayla
1 messages · Page 1 of 1 (latest)
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
if you disable the gameobject, its disabled
oh thats a disable
well if you "hide" it, it will be disabled
disable the sprite renderer?
just to see what buttons do
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
i would definitely learn the layout of unity, pressing random buttons can lead to bad things
if you assign it in the inspector
im not pressing random buttons
is there a noticeable difference from using
serializefield with private variables
or just using public variables
yes
i already told you what serializefield does
serializing a private variable will make it visible in inspector but not visible to other scripts
while public does both
so if i make a public variable i can reference it in another script
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
the videos specifically explain how the commands work
this works just the same to me
same with videos
with the advantage of answering more specific questions
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
im not talking about buttons
where is my angry old guy cloud thing
i have specific questions all the time
actually i have another question right now 
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
huh
just do .sprite = newSprite
websites lying to me again
hold on that doesnt work
did you mean something other than .sprite
dont think so
but you can check the docs
should be that
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
i dont know what you mean by that
the same way you changed the colour on your rendrer
but now your doing sprite
on a SPRITE RENDERER
SpriteRend.sprite //this is a reference = mysprite;
spriterend doesnt exist
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
im not just gonna give you the answer or else you wont learn?
the whole point is ill learn from the answer
we have to teach you
youve done this a hundred times
with the rigidbody
renderer
same thing with the sprite renderer now
the same way you add force
or change the color
you now change the sprite...
its not that complicated
when you did .normalize that right there is a reference
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
yes you did
the reference to the sprite renderer
you can use .sprite on nothing
it was not the thing you think im thinking of
cant
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
and the rest i gave you the code ages ago?
use the reference
to your sprite renderer
you cant use .sprite on nothing
im supposed to do the inspector thing now?
private SomeVariableType variableName;
variableName.Something = 5;
variableName.DoSomething();
//"variableName" is your reference
because you have an error
then listen
and analyze
to what im saying
look at my code example
i tell you what a reference is
sr?
variable name........
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
i could have a fully working multiplayer game by the time you learn basic C# and Unity code 🤦♂️
woah thats so weird maybe its because im a beginner and youre not
ive barely touched Unity in the past 3 years
you clearly know miles more than me
he retained the information
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
aaagh annoying
or just have an actual sprite
how do i get around this
and drag it in
like turn it into one
idk why you have a prefab of a GameObject
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
why are you turning anything into a sprite
do you have a png?
your image
that you want to use?
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
so what you wanna do here is just completely changeout the entire GameObject not the sprite?
huh
well since you dont have a sprite
changing a sprite of the SpriteRenderer isnt possible
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
what image
how does that sound stupid
if your "image" is multiple game objects
then thats your fault
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
first of all i have no clue, not a bit of information of what it ACTUALLY is
you havent shown me a single screenshot
two squares
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
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
ok doesnt matter, same principle
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
because its not a png
its 2 sprites rendered by 2 different SpriteRenderers
surely theres a way to just take the image of whats shown on screen and use that
that doesnt even make sense
this is the way to do it
or make some actual art
and swap the sprite
i dont really get it
do i like
put the outline bit
as a child
on the regular box
'table'
make the outline one and the not outline one both childs
and enable disable it
make the parent have NO sprite renderers
make it just have Rigidbody, Colliders, etc.
i mean the
non outline one
is literally an exact copy of the parent
whats the point of that
because its a visual
which you might scale
it should be a child
the parent should only hold the Key components.
rigidbody, colliders, scripts
like this
the children dont need that
if i remove that script it wont be the right colours
parent has the script with collider and rigidbody
the 2 children are VISUALS ONLY with a SpriteRenderer
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
yes, which you do by activating and disabling the GameObject's (the children)
and enable it
yeah
waaait
if i disable both of them itll just be blank
do you mean just the one
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
zero context but ill try
ok let me explain this
wouldnt i need to add the name of the thing i want to disable
which means what you would do is
private GameObject myObject;
myObject.SetActive(true);
this same principle applies to any other piece of code in the documentation
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
