• 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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



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

How to add force to dice so it rolls all over the table and it turns in while being thrown 1 Answer

Error 0xc000007b and msvcr100.dll issues 4 Answers

Android Project Split Build Troubles 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges