#is one of these part of the scene
1 messages · Page 1 of 1 (latest)
ok
something cause the prefub to be instantiated with some components not active
sometimes unity disables component if there is some type of NullRef in awake iirc
but there is no error
thats why it disables them
so there is no error
but it only happens sometimes a certain conditions
are you sure its not cloning a scene object instead of a new prefab
wdym its runtime ?
i mean that it can encounter the missing reference only at the runtime which means it had to encounter the error
then it could handle it by turning off the component
oh sorry, true
i put one manually and then it destroyed and creating new in the player
show the public Weapon weapon;
your naming is confusig as shit
close weapon?
CloseWeapon is the prefab and the Script
its just confusing not a problem
CloseWeaponPrefab would make more sense
anyway no worries
nothing here would disable those components rn
can you tell me when that happens exactly
also the box collider is disabled too..
are those two referenced somewhere ?
ok ill try to explain the flow there, but tbh the course is weird because there are some other related things there that make no sense to me
idk!!! and they have some weird logic error i cant understand
shitty course
ok, in their code there is no reference at all if a weapon is equipped or not
but somehow only the equipped weapon move and shoot
and for me, all the waepons react to my inputs (as they logically should!)
Its hard for me to conceptualize the differences right now, I would suggest maybe start a few steps back and retrace the path
by thier logic when all weapon have the weapon tag and pickup script, on that script you add prefub of the weapon they will put on the player
https://gdl.space/logifitine.cpp
I havent seen the course
you're passing a Clone no ?
that implies an already spawed object
and this is how they handle the equip
prob one with disabled components perhaps and maybe its cloning /spawning that?
that destroy is sketch
when defining it im using prefubs
none of them are diasbled
why would anyone put such a shit Destroy lol
IK! how can they get the correct weapon like this
no quality checks on udemy huh
all have the same tag
stupid AF
all of the logic in that course make my brain cry
but it what i got...
what is the course on exactly?
oh
get ur money back lol
I cant believe ppl actually bought this
its from a friend haha
such shite code
do you have a reccomaned one?
the !learn ones
:teacher: Unity Learn ↗
Over 750 hours of free live and on-demand learning content for all levels of experience!
exactly what i told my friend, i can learn from him but even without knowing C# i know the code is garbage
its not good to follow a course to learn bad practices
this whole system is flimsy it seems
im not gonna mimic any practices, just get familier with the UI
I suggest the learning paths from unity
start from a few lessons back and see what you missed maybe
i tried that ):
otherwise just chalk it up as shitty and move on
):
if it didnt teach you well, then it didnt do its job
:\
try taking a break from this one and look at other courses on Learn
structure courses are always proficient
yours is not a structured course. More like "Copy what I do "
usually crash courses are perfect for me
i get the gist from it and then can continue alone
but it just dont work.. and i dont understand
ok, so how would you approche this issue?
how would you design equipping dropped weapon?
what do you want to know, shouldn't be that difficult. I've done it plenty
how to design it?
now there is a weapon on the player from the begining
and on pick up they delete (randomly...) the weapn and use Instantiate to create the new one
would you do it the same?
no I would not because is actually expensive to keep Destroying and Instantiating
I just disable the weapos and put the inside a Pool of weapons
the when i need one I just enable it and thats that
Spawning so many weapons is unecessary
so all weapon are already on the player
sometimes, or sometimes they get paranted from another one thats holding all the weapons
ObjectPooling almost on anything
especially bullets
also I use an Interface to interact with pickups
anyway I gotta run for a few
aright tnx!
ill try to work around it and the get into https://learn.unity.com/
this one is recommended
https://learn.unity.com/pathway/unity-essentials
if you havent already