Closed Arfenhaus closed 8 years ago
Which example scene are you trying it in?
I've just tried the bezier pointer in 009_Controller_BezierPointer
and it seemed to be teleporting ok
Yes it works in that scene in another project, yet not in my own. So that narrows it to something I did, at least.
At what point does the Bezier script send notice to the Teleport script to run it's functions? Or where would changing outside the Bezier script only affect the Bezier script?
So I downloaded the latest commits of WorldPointer, SimplePointer, and BezierPointer and replaced what I had. That got it working perfectly.
Then, related shenanigans. I tried placing a custom pointer cursor (a 2D image on a canvas paired with a transparent cube mesh), it made the cursor and pointer invisible, as well as the teleport unworkable. I deleted the custom object from the Inspector, but that didn't fix the problem. Console kept spitting out:
NullReferenceException: Object reference not set to an instance of an object VRTK.VRTK_WorldPointer.Update () (at Assets/SteamVR_Unity_Toolkit/Scripts/Abstractions/VRTK_WorldPointer.cs:104) VRTK.VRTK_BezierPointer.Update () (at Assets/SteamVR_Unity_Toolkit/Scripts/VRTK_BezierPointer.cs:51)
Now, I've narrowed this issue to my attempts to have the 2D image always facing the Player when the teleport beam is showing by accessing the custom cursor point GameObject Rigidbody and freezing X and Z constraints. If I have the commented lines enabled:
` protected override void InitPointer() { pointerCursor = (customPointerCursor ? Instantiate(customPointerCursor) : CreateCursor());
pointerCursor.name = string.Format("[{0}]PlayerObject_WorldPointer_BezierPointer_PointerCursor", this.gameObject.name);
pointerCursor.layer = 2;
pointerCursor.SetActive(false);
//pointerCursor.GetComponent<Rigidbody>().constraints = RigidbodyConstraints.FreezeRotationX;
//pointerCursor.GetComponent<Rigidbody>().constraints = RigidbodyConstraints.FreezeRotationZ;
curvedBeamContainer = new GameObject(string.Format("[{0}]PlayerObject_WorldPointer_BezierPointer_CurvedBeamContainer", this.gameObject.name));
curvedBeamContainer.SetActive(false);
curvedBeam = curvedBeamContainer.gameObject.AddComponent<CurveGenerator>();
curvedBeam.transform.parent = null;
curvedBeam.Create(pointerDensity, pointerCursorRadius, customPointerTracer);
base.InitPointer();
}`
Then everything fails. If I follow the debug log and comment out :
` protected virtual void Update() { if (activateDelayTimer > 0) { activateDelayTimer -= Time.deltaTime; }
// if (playAreaCursor.activeSelf)
// {
// UpdateCollider();
// }
}`
Like so in WorldPointer, teleporting works but without the beam or cursor showing. Is there a way to have a 2D image as the Bezier tip always face the player?
Hi again! For some reason, with zero fiddling around in the code of it, Bezier Pointer has stopped signaling teleportation. I've reimported, copied and pasted the latest revision directly into the code, still nothing. I didn't change a single line in the script, the only thing I've changed is in DropToNearestFloor in HeightAdjustTeleport, here, to disable the blink when falling to the ground (and I don't think it has anything to do Bezier pointer):
`())
// {
// Blink(blinkTransitionSpeed);
// }
// if (withBlink && !rayCollidedWith.transform.GetComponent