Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by UmbralDreams · Oct 21, 2017 at 10:06 PM · array of gameobjectstroubleshootinglinqdicearray list

3 Dice checking trouble......Array? List? Linq?

HI guys....I'm really lost trying to find a answer for this....

I'm trying to do a dice throwing game (Ceelo \ strunk flower game). I already made the script for identify wich side is up and already made the die prefab. Now it goes..... I have to throw 3 dices, so as my enemy. Both of us have 4 turns. If one of us hit some certain numbers, we win, lose or its a draw (some rules for example: if i hit a 6-6-1 and the other a 2-2-6, he wins. If I hit a triple 5 and the other a triple 4, he loses. If i hit a 1-2-3 I lose. All these examples it doesnt matter the order of the dices)

I'm already trying to learn about the turn based scheme but about the results....I must have 3 arrays? lists? I know i have to compare the player throws vs the enemy throws with the rules. Shit is giving me bluescreen in my brain. Some guy told me about linq, but i didnt understood that.

I really appreciate if you guys can help me...... I don't know if this is gonna help, but here it is my diceCheck script:

public class DiceNumberUp : MonoBehaviour {

 int CalcSideUp()
 {
     float dotFwd = Vector3.Dot(transform.forward, Vector3.up);
     if (dotFwd > 0.99f) return 4;
     if (dotFwd < -0.99f) return 3;
     float dotRight = Vector3.Dot(transform.right, Vector3.up);
     if (dotRight > 0.99f) return 2;
     if (dotRight < -0.99f) return 5;
     float dotUp = Vector3.Dot(transform.up, Vector3.up);
     if (dotUp > 0.99f) return 6;
     if (dotUp < -0.99f) return 1;
     return 0;
 }
 void Start()
 {
     int side = CalcSideUp();
     if (side > 0) Debug.Log("Side = " + side);
 }

}

Comment
Add comment
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

0 Replies

· Add your reply
  • Sort: 

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

117 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

how to RemoveAt 2 Answers

Drop item based on die roll 1 Answer

Some LINQ functions won't work. And no; not iOS 0 Answers

Instantiated GameObject is Invisible on Android -- But is Visible in Inspector (Should be Visible) 1 Answer

Unity Editor Crashing when i try to make a new project 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