|
i dont get why this script is giving me a lot of errors its like right out of the reference material. i am thinking it has to do with the if and the on trigger, but i could be completely wrong any help? after i did the above code i looked around and found my errors..... i think... but i am still having trouble any help?
(comments are locked)
|
|
Your code seems to do nothing since you're trying to have the object to look at itself. This is my best guess for what you want to do: In this solution there is no Update function at all. state is still alive :O
Jul 29 '11 at 11:25 AM
biohazard
i guess i am looking at the wrong material for what i want to do, but these are great examples thanks for the help but they didn't solve my problem.
Jul 29 '11 at 06:42 PM
IMTRIGGERHAPPY9
(comments are locked)
|
|
Something like the following (which hasn't been compiled so expect a few typos):
(comments are locked)
|
|
Because the function OnTriggerEnter is an own function and must be outside of the Update function where you put it in by error so the OnTriggerEnter is like the update where it looks for it every frame right? well then how would i go about doing this because i want my if to control that function, can you even have if's control functions?
Jul 29 '11 at 06:50 AM
IMTRIGGERHAPPY9
Yes. it will keep checking if the trigger was hit UNTIL it was hit, i think you might have to reset it then but i don't really know. Alternatively you could try working with Raycasts and collider
Jul 29 '11 at 07:14 AM
biohazard
(comments are locked)
|

"its like right out of the reference material", could you please provide a link to the reference material because that looks wrong and should be corrected.