#is one of these part of the scene

1 messages · Page 1 of 1 (latest)

foggy quiver
#

no, is it ok to reply in a thred?

glad geyser
#

ok

foggy quiver
#

something cause the prefub to be instantiated with some components not active

glad geyser
foggy quiver
#

but there is no error

glad geyser
#

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

foggy quiver
#

but its run time

#

im sure

#

but ill drag it again

glad geyser
foggy quiver
#

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

glad geyser
#

which one is Close weapon again

#

send script

#

and the one thats spawns it

foggy quiver
#

no one spawns it now

#

i put it there manually

glad geyser
#

it says (Clone)

foggy quiver
#

oh sorry, true

#

i put one manually and then it destroyed and creating new in the player

glad geyser
#

show the public Weapon weapon;

foggy quiver
glad geyser
#

no i mean

#

the field in the inspector

foggy quiver
#

maybe it recursion?
because the Pickup script in the prefub have the prefub in it?

glad geyser
foggy quiver
#

close weapon?

glad geyser
#

CloseWeapon is the prefab and the Script

foggy quiver
#

is that a problem?

#

i thought its standard

glad geyser
#

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

foggy quiver
#

also the box collider is disabled too..

glad geyser
#

are those two referenced somewhere ?

foggy quiver
#

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

glad geyser
#

wait your following a course ?

#

how come they dont have the same problem

foggy quiver
#

idk!!! and they have some weird logic error i cant understand

foggy quiver
#

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!)

glad geyser
#

Its hard for me to conceptualize the differences right now, I would suggest maybe start a few steps back and retrace the path

foggy quiver
#

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

glad geyser
#

I havent seen the course

glad geyser
#

that implies an already spawed object

foggy quiver
#

and this is how they handle the equip

glad geyser
#

prob one with disabled components perhaps and maybe its cloning /spawning that?

#

that destroy is sketch

foggy quiver
#

none of them are diasbled

glad geyser
#

why would anyone put such a shit Destroy lol

foggy quiver
#

IK! how can they get the correct weapon like this

glad geyser
#

no quality checks on udemy huh

foggy quiver
#

all have the same tag

glad geyser
#

exactly or what if multiple ones exist

#

how would it know the right one to destroy

foggy quiver
#

stupid AF
all of the logic in that course make my brain cry

#

but it what i got...

glad geyser
#

what is the course on exactly?

#

oh

#

get ur money back lol

#

I cant believe ppl actually bought this

foggy quiver
#

its from a friend haha

glad geyser
#

such shite code

foggy quiver
#

do you have a reccomaned one?

glad geyser
#

Blackthornprod draws good

#

but his code is ass

#

hes not a real programmer

glad geyser
inland echoBOT
#

:teacher: Unity Learn ↗

Over 750 hours of free live and on-demand learning content for all levels of experience!

foggy quiver
#

exactly what i told my friend, i can learn from him but even without knowing C# i know the code is garbage

glad geyser
#

this whole system is flimsy it seems

foggy quiver
#

im not gonna mimic any practices, just get familier with the UI

glad geyser
#

I suggest the learning paths from unity

foggy quiver
#

but i just cant understand how it worked for them..

#

wil do

glad geyser
foggy quiver
#

i tried that ):

glad geyser
#

otherwise just chalk it up as shitty and move on

foggy quiver
#

):

glad geyser
#

if it didnt teach you well, then it didnt do its job

foggy quiver
#

oof

#

i got OCD for those things... i need to understand how it worked there

glad geyser
#

:\

#

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 "

foggy quiver
#

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?

glad geyser
foggy quiver
#

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?

glad geyser
#

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

foggy quiver
#

so all weapon are already on the player

glad geyser
#

ObjectPooling almost on anything

#

especially bullets

#

also I use an Interface to interact with pickups

#

anyway I gotta run for a few

foggy quiver
#

aright tnx!

glad geyser
#

if you havent already