-2
Debug.logはAwake()
機能では正常に動作しますが、FixedUpdate()
では正常に動作しません。わからないあなたはFixedUpdate
をする必要があり、関数名FixedUpdated
に余分d
を追加したようFixedUpdateのデバッグログが機能しません
using UnityEngine;
using System.Collections;
[RequireComponent(typeof(SteamVR_TrackedObject))]
public class PickupParent : MonoBehaviour {
SteamVR_TrackedObject trackedObj;
void Awake() {
trackedObj = GetComponent<SteamVR_TrackedObject>();
Debug.Log("debug log is working");
}
// Update is called once per frame
void FixedUpdated() {
SteamVR_Controller.Device device = SteamVR_Controller.Input((int)trackedObj.index);
if (device.GetTouch(SteamVR_Controller.ButtonMask.Trigger))
{
Debug.Log("You are holding down the 'Touch' on the Trigger");
}
}
}