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 /
avatar image
0
Question by Xamur · Sep 28, 2016 at 03:05 PM · runtimechangerandom.rangesetactivebool

Reigns Game - Use Random.Range at Start() and a second time via another script and set GameObject as active

Hello folks, I hope the title is interesting enough, so many people look at this question.

I'm currently working on a Project which contains 2D and 3D elements. This game works like the mobile game "Reigns" and is very simple:



In the center of the main camera is an image, The image should be a "card". It isn't 2D (so no UI or sprite), I used a 3D cube, so I could write a moving script for it myself. Above the card there is a textfield which is a question. You can move the card to the left (there is a trigger) and also to the right (another trigger). Left means that you reply to the question with "Yes" or, when you move it to the right, with "No".

It's not important in this case if you answer with "Yes" or "No", because after the card exits one of the trigger ( OnTriggerExit ) , then a new question and a new card should appear, but that does not really work.

Everything works fine for the first randomized card!


Now to my Problem:

At the beginning within the method void Start() a number gets randomized. After that, the if-statement within the method void checkingCards() tries to find out which card and question will appear when (for example) number 3 gets generated randomly. Until here everything works, as I said!. When I reply now with "Yes" or "No" a second/new random number should be generated and another card and question should appear.

This step doesn't work correctly and I don't know exactly how I could solve it, because I tried so many things but nothing worked.

If anyone understood what I want to achieve then I would appreciate any help which helps. If you don't got what I wanted to say just tell me and I try to explain better.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Simple GameObject Hide/Unhide with bool!!! 0 Answers

Change and add Terrain Texture During Runtime 1 Answer

Changing a second objects material on trigger 0 Answers

Change 'Color Mask' Property At Runtime 1 Answer

check if the bool is true from other script c# 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