#This is why I said initialy that it
1 messages ยท Page 1 of 1 (latest)
my issue is that only my last pasted prefab instance utilized more from the code. I feel it has something to do with the GameObject.find().. why do I think this? idk
!code
๐ Large Code Blocks
Large code blocks should be posted as links to services like:
https://gdl.space/, https://paste.ofcode.org/, https://hatebin.com/
https://paste.myst.rs/, https://hastebin.com/
๐ Inline Code
Surround code with three backquotes. Not quotation marks.
To get C# formatting the first line should only contain cs or csharp.
Add a comment with a line number if there is an error message.
```cs
// Your code here
```
Do not share screenshots of code unless requested.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
what calls Initialize()?
the : agent
Idk how much you know and I dont want to sound like I know because this is my first time with c# but I do code in java so its prolly like an abstraction
I just override it
but the reason why I think its the gameobject.find()
look
see the first 2 lines of code
those do work
but the next ones
the ones that use 'bones' that uses gameobject.find() guess what? they dont work
yeah, it'll just grab any random object called Spider and Cube. and the bones too, i guess.
basically not a good case for using find
is there any reason you can't use lists?
just init the individually?
i just don't get the whole process of what's happening, like you're naming the bones and then finding them? are the bones generated? why are they not referenced in the first place?
I am using the 3 names
Jaw, PitchA and PitchB
and give them all a number 1 to 8
those are my 24 bones I want
with the names generated (cos im lazy to make on big list) I find the objects
yeah idk this reads like spaghetti
what how
but the general idea is that if you're generating them, then add them to list as you generate
I am not generating the bones
if they're all manual, then just dump them into a list manually
The bones are there
make a serialized or public list and just drag all of these bones there
Im just using a function to find em
why are you finding them when they're right there
that's not what find is supposed to be used for
How else would I refrence them
open up inspector in unity,
select all the bones
drag them to the list in the inspector
what list in inspector
make it public or [SerializeField]
why are you doing this shit if you didn't even check basics of unity
the time it'd take you to just go through intro for beginners would save you the entire time you are stuck with this problem
and mine too
it's basically same as java so no problems there
Can you link me for the serialized thing you are telling me
true, just better tho
yeah but what am I serializing tho?
it basically shows the list in unity's inspector and allows you to edit it right there
so you can make references without touching code
it's automatically shown if it's public
so I would do that in the prefab, do the thing in inspector, and then it would do that thing everywhere
makes sense to me
yep
Ill prolly get rid of the whole thing Im doing
good
XD
@left osprey
What do you think : D
better?
I did not use SerializeField tho?
what the fuck is wrong with you
you know how to make a list, are you trolling?
array is fine too
ignore that
I just tested what you said
it euh yeah
this might be faster xd
Fuck I have to redo
@left ospreywhat am I doing wrong?
Im sorry to ping you again but like
where are they
am I stupid?
when I did this, I saw a list show up
try uninitialized?
i guess it's only list then
[SerializeField] List<Transform> bones = new();
it's strange that array doesn't show up though, i remember making one and being surprised that it showed up in inspector and could be used same as list
so weird thing
I went ctrl+z all the way back
removed what I didnt need and it works
๐ค
I saved a lot I saw it refresh