Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UdonSharp;
- using UnityEngine;
- using VRC.SDKBase;
- using VRC.Udon;
- using VRC.Udon.Common.Interfaces;
- public class VRC_button_A_matt1 : UdonSharpBehaviour
- {
- public Transform target;
- Vector3 aperta = new Vector3(-0.207f, -1.63f, -0.56f);
- Vector3 chiusa = new Vector3(-0.207f, 1.197f, -0.56f);
- void Start()
- {
- Debug.Log("started VRC_button_A_matt1");
- target.localPosition = chiusa;
- }
- public override void Interact()
- {
- Debug.Log("Interacted");
- SendCustomNetworkEvent(NetworkEventTarget.All, "NetworkEventStuff");
- }
- public void NetworkEventStuff()
- {
- if (target.localPosition == aperta)
- {
- target.localPosition = chiusa;
- }
- else
- {
- target.localPosition = aperta;
- }
- Debug.Log("changing position to " + target.localPosition);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement