Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by mister.keith · Apr 29, 2012 at 06:13 AM · c#arrayssequence

Sequence Scripting

So, currently I am working on a game that uses a 3x3 grid. Like so:

1-2-3

4-5-6

7-8-9

nodes 1 through 9 are all in the off setting. each have a total of 4 colors (off, yellow, green and purple)

I am trying to write a script that allows the computer (AI) to select a sequence of the buttons that the player will have to follow within a certain amount of time from the computer finishing the sequence the colors don't matter in this situation (i just let you know of the colors showing there are multiple states for the buttons. I found some information on how to script a Simon Says game (the one with one unit and 4 color plates but that doesn't really resolve my situation let alone tell me where to even start.

Is it possible/plausible for me to write a script that will destroy the nodeOff gameObject and instantiate one of the other colors as a prefab? Is this efficient? What would be a best practice in this situation? How would I tackle this as a beginning programmer?

Thank you so much!

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image kolban · May 01, 2012 at 02:22 AM 0
Share

In the grid, are the elements GUI Buttons or are they Game Objects?

avatar image mister.keith · May 01, 2012 at 03:13 PM 0
Share

The gird is comprised of game objects. Thanks for the clarifying question!

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by mister.keith · May 25, 2012 at 07:33 PM

I ended up using a series of if statements and ray casts to really work the AI and then I attached it to a game manager GO. Instead of different colored blocks I also used area lights for a much better effect. I am still interested in how other people may have gone about doing this!

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Bunny83 · May 25, 2012 at 07:34 PM 1
Share

Thanks for co$$anonymous$$g back to answer your own question ;) I will accept your answer so it's closed ;)

avatar image
0

Answer by leodluz · Mar 04, 2018 at 09:00 PM

https://forum.unity.com/threads/bsd-button-sequence-detector-combos.520051/

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Distribute terrain in zones 3 Answers

NullReference when accessing GameObject in array (C#) 1 Answer

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Multiple Cars not working 1 Answer

Conceptual Question on Creating Arrays at Runtime 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges