This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

  • 0
Sign in to follow this  
Followers 0
lucian112

Door timer script!

Question

Hello!I'm sorry for onother stupid question,just when i get open door script on timer,and close like in 30 seconds?Sorry for stupid question

Share this post


Link to post
Share on other sites

2 answers to this question

  • 0

function Open()

{

// open door

yield WaitForSeconds(30);

//close door

}

1 person likes this

Share this post


Link to post
Share on other sites
  • 0

In C# you need to call a coroutine, and be sure to use a boolean condition which will uncheck at the end of the coroutine, so it won't execute over and over again.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0