|
Hello all. This is my first post on the site, and I'm having some problems with Yield WaitForSeconds. I'm just plain confused and know nothing really about this. I have a script that uses iTween to switch camera positions from first person to third person. I then have another script that deactivates my first person model and activates my third person one. Switching from first to third person works fine, but when I switch back to third person, the first person and third person models activate before the camera zooms in, and I am trying to get it to wait by using WaitForSeconds. Could someone help me? Here's my script so far:
(comments are locked)
|
|
I don't see any yield instructions. Anyway, I don't think Update can be one. What you could do is create a function that call Model.SetActiveRecursively, and use Invoke to call it later. Oh. Sorry! I meant that's what I have so far, without the yield instructions. I tried just writing WaitForSeconds above "Model.SetActiveRecursively", but that failed miserably :3
Feb 29 '12 at 05:38 AM
iSlaytheDe4d
Ok then, I don't know if you're familiar with Invoke(), it's a fairly simple function. After the if( Input...), add Invoke( "MyFunction", 2 );. Then inplement my function with the SetActiveRecursively inside. Now when you press the key, it's going to wait 2 secondes and call MyFunction(). Doc
Feb 29 '12 at 06:32 AM
Berenger
(comments are locked)
|
