Advertisement
salahzar

VRC_button_A_matt1.cs

Feb 28th, 2021
881
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.70 KB | None | 0 0
  1.  
  2. using UdonSharp;
  3. using UnityEngine;
  4. using VRC.SDKBase;
  5. using VRC.Udon;
  6.  
  7. public class VRC_button_A_matt1 : UdonSharpBehaviour
  8. {
  9.     public Transform target;
  10.  
  11.     Vector3 aperta = new Vector3(-0.207f, -1.63f, -0.56f);
  12.     Vector3 chiusa = new Vector3(-0.207f, 1.197f, -0.56f);
  13.  
  14.     void Start()
  15.     {
  16.         Debug.Log("started VRC_button_A_matt1");
  17.         target.localPosition = chiusa;
  18.     }
  19.     public override void Interact()
  20.     {
  21.         if(target.localPosition == aperta)
  22.         {
  23.             target.localPosition = chiusa;
  24.         } else
  25.         {
  26.             target.localPosition = aperta;
  27.         }
  28.         Debug.Log("changing position to " + target.localPosition);
  29.     }
  30.  
  31. }
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement