#Some variable stuff, help for poor Sycarium.
1 messages · Page 1 of 1 (latest)
Figuring a branch can be used here.
@patent swallow you cant assign a value to the variable, which is a string... but you can get a component from another place where the variable is assigned a string?
ultimately, I'll have to get the string new string from a scriptable object.
wht are you trying to do exactly
ngh. mm.
you were told already to assign it and actually use it
wait a second.
you can't assign to it because it is a read-only property
but you can assign it to something else, though that just gets the current value of the string
thank you. I think it should work now.
you're not assigning to the variable on Task1PrefabTitleVariable
so that isn't doing what you think it is
hmm. you might be right on that. I did need to change the original text copy...
i am 100% right on that, it's clear from the code.
at this point you should go through some basic c# courses to get a better idea of how variables/properties/strings/etc work.
tbh, I probably know most of it. but I have forgotten some of it...
but why is it a read only property?
because you made it a read-only property.
I've alterered texts before...
i'm sure you have. but you created a read-only property instead of just making the variable public
every variable is public here...
except the original copy.
which is serialized private.
hint: properties are not themselves variables. you are exposing the private variable to other objects through a read only property
ah.
you cannot assign to the property because as i have explained multiple times now, it is read only.
yes. now I understand.
^this is how the "guides" do it.
I sort of assumed thats how it worked. but
that was wrong of me.
you can fix the issue by making the variable public and assign to that directly instead of through the property, or you can give the property both a getter and a setter. i'll let you decide how to accomplish that. i also still recommend some basic c# tutorials
it should be get private set public? or something along those lines
my understanding on get set is very limited rn.
or private get public set whichever.
sadly, tutorials on get set are very bad. :(
to show you what I mean...
this is what they show ^^'
finding how to use {get; private set;} ect. on one line initiations...
or...what they would mean. ^^' there's virtually no tutorial for that.
this does a few things. But setting the instance taskparent to the parent set in inspector is not one of them. I think while I used a name for it like newChild it did so, therefore the problem lies in the "instance". Still... another confusion thing is, that it does duplicate it, but not what lies inside "taskprefab". I have the renamed prefab file in there referred, with altered information... but it copies the "prefab" behind that prefab instead. Im unsure how to explain this properly.
yesterday, it worked pretty well with, well. the other name. :P but I dont think it'd get the change, cause that's set to this instance variant...