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 rapinnz · Jan 05, 2018 at 08:58 PM · script.vrproblem during runtime

Vive Vr Developing problem (Controllers Diapering because of script )

this script takes a Key and when it enters the game-object the script is attached to the key disappears and the chest lid swaps the other chest lid is able to be piked up with the vive controllers

 using UnityEngine;
     using System.Collections;
     
     public class Keyandlock : MonoBehaviour 
     {
         public GameObject Key;
         public GameObject chestLid;
         public GameObject chestlid2;
         public GameObject Hand1;
         public GameObject Hand2;
     
         void start ()
         {
             chestLid.SetActive (true);
             chestlid2.SetActive (false);
         }
             
         void OnTriggerEnter(Collider other) 
         {
             if (other.gameObject.tag == "Key") 
             {
                 Debug.Log ("Detected");
                 Key.SetActive (false);
                 chestLid.SetActive (false);
                 chestlid2.SetActive (true);
                 Hand1.SetActive (true);
                 Hand2.SetActive (true);
             }
         }
     }

this is the second script doing the same thing but on a door.

 using UnityEngine;
 using System.Collections;
 
 public class Door : MonoBehaviour 
 {
     public GameObject DoorKey;
     public GameObject Door1;
     public GameObject Door2;
     public GameObject Hand1;
     public GameObject Hand2;
     public GameObject Lock;
 
 
     void Start () 
     {
         Door1.SetActive (true);
         Door2.SetActive (false);
         Lock.SetActive (true);
     }
     
     void OnTriggerEnter(Collider other) 
     {    
         if (other.gameObject.tag == "Keyone") 
         {
             Debug.Log ("Unlocked");
             Door1.SetActive (false);
             Door2.SetActive (true);
             DoorKey.SetActive (false);
             Hand1.SetActive (true);
             Hand2.SetActive (true);
             Lock.SetActive (false);
         }
     }
 }

Whenever I Use the controllers to put the key in the trigger the controllers disappear. plz help Whenever i set the blank hand 2 on the first image to active i can then see the controller but none of its scripts are active.

alt text alt text

hierarchy.png (23.5 kB)
inspector-hand2.png (24.2 kB)
Comment
Add comment · Show 1
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 rapinnz · Jan 06, 2018 at 07:49 PM 0
Share

I found out the controller was being .Setactive (false) because it was connected to the key when i put the key in the chest key hole so i set it so that the key would not have its .Setactive (false).

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by rapinnz · Jan 06, 2018 at 07:07 PM

please if anyone knows the answer. Im getting desperate.

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

149 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 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

c# - error CS0246: The type or namespace name `CardBoard' could not be found. Are you missing a using directive or an assembly reference? 1 Answer

Disabling unity premade script component,Disabling sealed public script component 1 Answer

SteamVR Interaction system. Small problem with Teleport points. 3 Answers

Recording Players voice in Unity using VR buttons. 0 Answers

How to include speed trigger creation option in this script. 0 Answers


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