#triggers
1 messages · Page 1 of 1 (latest)
use different scripts and two different gameobjects?
ok..
so basically what i have is 2 seprate game objects both with trigger colliders as seen in the first screen shot however if i enter lets say the back one whic has a script on it it does the exact same thing as the closer on even though they have seprate scripts
are they on teh same parent?
yes and heres my code for the back collider
i dnt think that would matter tbh
yes but diffrent objects
whats the script for the front one?
umm what ur saying dont make sense... if u disable 1 the other 1 does what the 1 u disabled did..
i dont think that'd help me understand whats going on
broo i just realised who you are i was watching your vids the other day
for 1 ive never seen anyone use Monobehaviours like that..
epic
epik
ok imma start with this one.. lol
OnTriggerEnter only happens the frame that u step into that collider
so.. in that code it'd run that whole block instantly... and unless u were a super human its doubtful u can press the L key down at the exact same frame
OnTriggerStay would run every frame u were in that trigger zone
so in that case u could listen for a keypress in that block
okthanks
np, if u change that out real quick u could retest that script
and then u could eliminate 1 error point in ur code u got now
it doesnt work
put a debug log in it
inside the OnTriggerStay but not inside the keypress check
or u could put a debug in both places and see which one/or any run
ok
so i fixed the part where the first script i sent u wasnt working but now i have the problem where both boxes can do both things
yea that part is still puzzling to me
ok
can you screenshot the inspector
ok
of the box colliders expanded.. and the script u have below it
the first one is the long script and the second is the shorter script