arcore-unity-extensions icon indicating copy to clipboard operation
arcore-unity-extensions copied to clipboard

Error on "Create an AR game using Unity's AR Foundation"-example

Open KillianStefan opened this issue 3 years ago • 23 comments

Hi!

I've followed the steps on example "Create an AR game using Unity's AR" which you can find here: https://codelabs.developers.google.com/arcore-unity-ar-foundation#3

At step 4 when editing the ReticleBehaviour script, the code editor and unity show mistakes in the copied script snippet. image

I've installed the same packages as shown in the first step (ARFoundation 4.1.5, ARCore XR Plugin 4.1.5) and I'm using the Unity version which is recommended in the tutorial, 2020.3 LTS.

image image

Changing the XRRaycastHit? in line 45 to ARRaycastHit? gets rid of the errors, and I can build the app, but it doesn't work properly, so I think this isn't the right way to tackle this problem. The reticle gets stuck in the position the smartphone is first held when starting the app, and doesn't move along the planes like it should according to the tutorial.

I've checked everything multiple times, and I don't know what to do. I've tried to use different versions of packages to no avail.

Can anyone please take a look?

Thank you so much!

Heislbesen

KillianStefan avatar Aug 09 '21 12:08 KillianStefan

Definitely agree it should be ARRaycastHit? hit = null; in your Line 45, as shown in the Completed version. I'll update the page immediately, thanks for that.

You could try comparing your scripts to the completed repository, or if you have a public or private repo to share, I could have a look at it too.

devbridie avatar Aug 09 '21 12:08 devbridie

Thanks for the really fast answer and for looking into the code!

I've started the completed version you posted - errors in runtime on Unity and on the smartphone the reticle is stuck, and no car model is appearing either when tapping on the screen.

KillianStefan avatar Aug 09 '21 12:08 KillianStefan

Hello. I've encountered the same problem. The reticle is not moving, no matter what I try to change in the code. ps: There's a bug in the code by the way. on line 46 in the image above I've changed from hits.Length to hits.Count since it seems there is no Length parameter.

I have ARFoundation 4.1.7 and Unity 2019.4.33f1

EmanueleFittipaldi avatar Nov 28 '21 20:11 EmanueleFittipaldi

Hello. I've encountered the same problem. The reticle is not moving, no matter what I try to change in the code. ps: There's a bug in the code by the way. on line 46 in the image above I've changed from hits.Length to hits.Count since it seems there is no Length parameter.

I have ARFoundation 4.1.7 and Unity 2019.4.33f1

Is there any insight/update on this issue?

I am attempting to run the "complete package" with the recommended Unity version (2020.3.2f1) and recommended AR Foundation and AR Core XR Plugin versions (4.1.5).

The reticule does not appear on the plane (instead it appears near to the phone's location at the app launch) and.... the reticule does not move, ever.

The Android Logcat shows a persistent NullPointerException in ReticleBehaviour.Update() which would seem to be the culprit... (note I am using the code included with the complete package linked above.)

... 2022/01/27 15:17:30.733 2980 11647 Verbose Unity-ARCore Configuration property LightEstimationMode changed: 1 => 2 2022/01/27 15:17:30.733 2980 11647 Verbose Unity-ARCore Configuration property PlaneFindingMode changed: 3 => 1 2022/01/27 15:17:30.733 2980 11647 Verbose Unity-ARCore Configuration property FocusMode changed: 0 => 1 2022/01/27 15:17:30.733 2980 11647 Verbose Unity-ARCore Configuration property InstantPlacementMode changed: 0 => 2 2022/01/27 15:17:30.733 2980 11647 Verbose Unity-ARCore Configuration will be updated with these features enabled: 2022/01/27 15:17:30.733 2980 11647 Verbose Unity-ARCore RearCamera 2022/01/27 15:17:30.733 2980 11647 Verbose Unity-ARCore PositionAndRotation 2022/01/27 15:17:30.733 2980 11647 Verbose Unity-ARCore PlaneDetection 2022/01/27 15:17:30.733 2980 11647 Verbose Unity-ARCore AutoFocus 2022/01/27 15:17:30.733 2980 11647 Verbose Unity-ARCore LightEstimationAmbientSphericalHarmonics 2022/01/27 15:17:30.733 2980 11647 Verbose Unity-ARCore LightEstimationMainLightDirection 2022/01/27 15:17:30.733 2980 11647 Verbose Unity-ARCore LightEstimationMainLightIntensity 2022/01/27 15:17:30.733 2980 11647 Verbose Unity-ARCore Raycast 2022/01/27 15:17:30.733 2980 11647 Verbose Unity-ARCore OnBeforeSetConfiguration 2022/01/27 15:17:30.738 2980 11802 Info native I0127 15:17:30.738534 11802 logger.h:28] CameraMetrics: OpenCamera: 80.508855ms 2022/01/27 15:17:30.741 2980 11647 Verbose Unity-ARCore AugmentedImageDatabase: 0x705a233fd0 2022/01/27 15:17:30.741 2980 11647 Verbose Unity-ARCore LightEstimationMode: 2 2022/01/27 15:17:30.741 2980 11647 Verbose Unity-ARCore PlaneFindingMode: 1 2022/01/27 15:17:30.741 2980 11647 Verbose Unity-ARCore UpdateMode: 0 2022/01/27 15:17:30.741 2980 11647 Verbose Unity-ARCore FocusMode: 1 2022/01/27 15:17:30.741 2980 11647 Verbose Unity-ARCore AugmentedFaceMode: 0 2022/01/27 15:17:30.741 2980 11647 Verbose Unity-ARCore DepthMode: 0 2022/01/27 15:17:30.741 2980 11647 Verbose Unity-ARCore InstantPlacementMode: 2 2022/01/27 15:17:30.741 2980 11647 Info native I0127 15:17:30.741420 11647 session.cc:559] Session::CheckAndWriteCurrentConfig returning OK. 2022/01/27 15:17:30.742 2980 11828 Info native I0127 15:17:30.742358 11828 android_sensors.cc:51] Gyro min delay 2.404ms requesting 5ms 2022/01/27 15:17:30.742 2980 11802 Info native I0127 15:17:30.742697 11802 camera_ndk_wrapper.cc:27] Loading Android NDK 28 symbols from libcamera2ndk.so 2022/01/27 15:17:30.743 2980 11802 Info native I0127 15:17:30.743185 11802 camera_ndk_wrapper.cc:47] Successfully loaded Android NDK 28 libcamera2ndk.so symbols. 2022/01/27 15:17:30.747 2980 11647 Info tflite Replacing 69 node(s) with delegate (TfLiteXNNPackDelegate) node, yielding 3 partitions. 2022/01/27 15:17:30.748 2980 11828 Info native I0127 15:17:30.748502 11828 android_sensors.cc:51] Accel min delay 2.404ms requesting 5ms 2022/01/27 15:17:30.748 2980 11647 Info native I0127 15:17:30.748968 11647 pursuit_tracker.cc:1516] AugmentedRegion config changed, enabled:1, quad:false, downsample:true, global reacquisition:false, lite mode:false, adaptive frame delay:false, interpolation:true, feature match stats:false, sharpness score computation:false, enable_pursuit_higher_frequent_reacquisition_on_roi:false, enable_profiling:false 2022/01/27 15:17:30.750 2980 11647 Info native I0127 15:17:30.750021 11647 session.cc:3330] Update Frame Delay to 3 frames. 2022/01/27 15:17:30.750 2980 11874 Warn native W0127 15:17:30.750357 11874 motion_analysis_calculator.cc:380] No input video header found. Downstream calculators expecting video headers are likely to fail. 2022/01/27 15:17:30.817 2980 11647 Error Unity NullReferenceException: Object reference not set to an instance of an object. 2022/01/27 15:17:30.817 2980 11647 Error Unity at ReticleBehaviour.Update () [0x00000] in <00000000000000000000000000000000>:0 2022/01/27 15:17:30.817 2980 11647 Error Unity 2022/01/27 15:17:30.822 2980 11647 Debug Unity [EGL] Request: ES 3.0 RGBA32 8888 24/8 2022/01/27 15:17:30.822 2980 11647 Debug Unity [EGL] Found: ID[11] ES 3.0 RGBA32 8888 24/8 2022/01/27 15:17:30.845 2980 11802 Info native I0127 15:17:30.845736 11802 logger.h:28] CameraMetrics: CreateCaptureSession: 102.528698ms 2022/01/27 15:17:30.846 2980 11802 Info native I0127 15:17:30.846456 11802 capture_request_utils.cc:207] Flash: ConfigureRequestFlashMode - OFF 2022/01/27 15:17:30.847 2980 11802 Info native I0127 15:17:30.847401 11802 logger.h:28] DataSourceMetrics: kFirstGlCallback: 190.645312ms 2022/01/27 15:17:30.847 2980 11769 Info native I0127 15:17:30.847416 11769 cameras.cc:1386] Camera 0 changed state CLOSED->OPEN; Camera device opened successfully. i=0 2022/01/27 15:17:30.847 2980 11769 Info native I0127 15:17:30.847500 11769 cameras.cc:1386] Camera 0 changed state OPEN->CAPTURING; Started capture session. i=1 2022/01/27 15:17:30.847 2980 11802 Info native I0127 15:17:30.847528 11802 capture_request_utils.cc:207] Flash: ConfigureRequestFlashMode - OFF 2022/01/27 15:17:30.848 2980 11647 Error Unity NullReferenceException: Object reference not set to an instance of an object. 2022/01/27 15:17:30.848 2980 11647 Error Unity at ReticleBehaviour.Update () [0x00000] in <00000000000000000000000000000000>:0 2022/01/27 15:17:30.848 2980 11647 Error Unity 2022/01/27 15:17:30.851 2980 11769 Info native I0127 15:17:30.851514 11769 cameras.cc:1386] Camera 0 changed state CAPTURING->RECONFIGURING; Changing runtime configuration... i=2 2022/01/27 15:17:30.922 2980 11647 Error Unity NullReferenceException: Object reference not set to an instance of an object. 2022/01/27 15:17:30.922 2980 11647 Error Unity at ReticleBehaviour.Update () [0x00000] in <00000000000000000000000000000000>:0 2022/01/27 15:17:30.922 2980 11647 Error Unity 2022/01/27 15:17:30.990 2980 11647 Error Unity NullReferenceException: Object reference not set to an instance of an object. 2022/01/27 15:17:30.990 2980 11647 Error Unity at ReticleBehaviour.Update () [0x00000] in <00000000000000000000000000000000>:0 2022/01/27 15:17:30.990 2980 11647 Error Unity 2022/01/27 15:17:31.059 2980 11647 Error Unity NullReferenceException: Object reference not set to an instance of an object. 2022/01/27 15:17:31.059 2980 11647 Error Unity at ReticleBehaviour.Update () [0x00000] in <00000000000000000000000000000000>:0 2022/01/27 15:17:31.059 2980 11647 Error Unity 2022/01/27 15:17:31.128 2980 11647 Error Unity NullReferenceException: Object reference not set to an instance of an object. 2022/01/27 15:17:31.128 2980 11647 Error Unity at ReticleBehaviour.Update () [0x00000] in <00000000000000000000000000000000>:0 2022/01/27 15:17:31.128 2980 11647 Error Unity 2022/01/27 15:17:31.133 2980 11634 Info CameraManagerGlobal Camera 0 facing CAMERA_FACING_BACK state now CAMERA_STATE_ACTIVE for client com.DefaultCompany.DriveARComplete API Level 2 2022/01/27 15:17:31.152 2980 11831 Info native I0127 15:17:31.152438 11831 logger.h:28] CameraMetrics: FirstCaptureComplete: 304.878385ms 2022/01/27 15:17:31.152 2980 11831 Info native I0127 15:17:31.152590 11831 android_camera.cc:1627] [Camera=0; State=RECONFIGURING] Camera completed repeating capture sequence 0 2022/01/27 15:17:31.152 2980 11831 Info native I0127 15:17:31.152622 11831 logger.h:28] CameraMetrics: LastCaptureComplete: 0 2022/01/27 15:17:31.152 2980 11769 Info native I0127 15:17:31.152709 11769 cameras.cc:1386] Camera 0 changed state RECONFIGURING->CAPTURING; [Camera=0; State=RECONFIGURING] Camera reconfigure complete. i=3 2022/01/27 15:17:31.153 2980 11647 Error Unity NullReferenceException: Object reference not set to an instance of an object. 2022/01/27 15:17:31.153 2980 11647 Error Unity at ReticleBehaviour.Update () [0x00000] in <00000000000000000000000000000000>:0 ... it continues until the NullReferenceException is the only log output.

minkaart avatar Jan 27 '22 22:01 minkaart

Has anyone run this example successfully?

GPROWIRELESS avatar Apr 13 '22 02:04 GPROWIRELESS

Has anyone run this example successfully?

Yes, I finally did there has been logical errors made by the developer. Two modifications needed to be done.

  1. In DrivingSurfaceManager.cs private void Start() { PlaneManager = GetComponent<ARPlaneManager>(); RaycastManager = GetComponent<ARRaycastManager>(); } Update the start with reference the Raycast Manager this will make the reticle function as intended.
  2. (Might be options) If the PackageSpawner.cs is causing some error. Make another class and paste the code in it. and Attack to an empty game object in the scene hierarchy.

managoy avatar Apr 13 '22 10:04 managoy

Hello. I've encountered the same problem. The reticle is not moving, no matter what I try to change in the code. ps: There's a bug in the code by the way. on line 46 in the image above I've changed from hits.Length to hits.Count since it seems there is no Length parameter.

I have ARFoundation 4.1.7 and Unity 2019.4.33f1

Yes, I finally did there has been logical errors made by the developer. Two modifications needed to be done.

  1. In DrivingSurfaceManager.cs private void Start() { PlaneManager = GetComponent<ARPlaneManager>(); RaycastManager = GetComponent<ARRaycastManager>(); } Update the start with reference the Raycast Manager this will make the reticle function as intended.
  2. (Might be options) If the PackageSpawner.cs is causing some error. Make another class and paste the code in it. and Attack to an empty game object in the scene hierarchy.

managoy avatar Apr 13 '22 10:04 managoy

Thanks for the really fast answer and for looking into the code!

I've started the completed version you posted - errors in runtime on Unity and on the smartphone the reticle is stuck, and no car model is appearing either when tapping on the screen.

Yes, I finally did there has been logical errors made by the developer. Two modifications needed to be done.

  1. In DrivingSurfaceManager.cs private void Start() { PlaneManager = GetComponent<ARPlaneManager>(); RaycastManager = GetComponent<ARRaycastManager>(); } Update the start with reference the Raycast Manager this will make the reticle function as intended.
  2. (Might be options) If the PackageSpawner.cs is causing some error. Make another class and paste the code in it. and Attack to an empty game object in the scene hierarchy.

managoy avatar Apr 13 '22 10:04 managoy

Hello. I've encountered the same problem. The reticle is not moving, no matter what I try to change in the code. ps: There's a bug in the code by the way. on line 46 in the image above I've changed from hits.Length to hits.Count since it seems there is no Length parameter. I have ARFoundation 4.1.7 and Unity 2019.4.33f1

Is there any insight/update on this issue?

I am attempting to run the "complete package" with the recommended Unity version (2020.3.2f1) and recommended AR Foundation and AR Core XR Plugin versions (4.1.5).

The reticule does not appear on the plane (instead it appears near to the phone's location at the app launch) and.... the reticule does not move, ever.

The Android Logcat shows a persistent NullPointerException in ReticleBehaviour.Update() which would seem to be the culprit... (note I am using the code included with the complete package linked above.)

... 2022/01/27 15:17:30.733 2980 11647 Verbose Unity-ARCore Configuration property LightEstimationMode changed: 1 => 2 2022/01/27 15:17:30.733 2980 11647 Verbose Unity-ARCore Configuration property PlaneFindingMode changed: 3 => 1 2022/01/27 15:17:30.733 2980 11647 Verbose Unity-ARCore Configuration property FocusMode changed: 0 => 1 2022/01/27 15:17:30.733 2980 11647 Verbose Unity-ARCore Configuration property InstantPlacementMode changed: 0 => 2 2022/01/27 15:17:30.733 2980 11647 Verbose Unity-ARCore Configuration will be updated with these features enabled: 2022/01/27 15:17:30.733 2980 11647 Verbose Unity-ARCore RearCamera 2022/01/27 15:17:30.733 2980 11647 Verbose Unity-ARCore PositionAndRotation 2022/01/27 15:17:30.733 2980 11647 Verbose Unity-ARCore PlaneDetection 2022/01/27 15:17:30.733 2980 11647 Verbose Unity-ARCore AutoFocus 2022/01/27 15:17:30.733 2980 11647 Verbose Unity-ARCore LightEstimationAmbientSphericalHarmonics 2022/01/27 15:17:30.733 2980 11647 Verbose Unity-ARCore LightEstimationMainLightDirection 2022/01/27 15:17:30.733 2980 11647 Verbose Unity-ARCore LightEstimationMainLightIntensity 2022/01/27 15:17:30.733 2980 11647 Verbose Unity-ARCore Raycast 2022/01/27 15:17:30.733 2980 11647 Verbose Unity-ARCore OnBeforeSetConfiguration 2022/01/27 15:17:30.738 2980 11802 Info native I0127 15:17:30.738534 11802 logger.h:28] CameraMetrics: OpenCamera: 80.508855ms 2022/01/27 15:17:30.741 2980 11647 Verbose Unity-ARCore AugmentedImageDatabase: 0x705a233fd0 2022/01/27 15:17:30.741 2980 11647 Verbose Unity-ARCore LightEstimationMode: 2 2022/01/27 15:17:30.741 2980 11647 Verbose Unity-ARCore PlaneFindingMode: 1 2022/01/27 15:17:30.741 2980 11647 Verbose Unity-ARCore UpdateMode: 0 2022/01/27 15:17:30.741 2980 11647 Verbose Unity-ARCore FocusMode: 1 2022/01/27 15:17:30.741 2980 11647 Verbose Unity-ARCore AugmentedFaceMode: 0 2022/01/27 15:17:30.741 2980 11647 Verbose Unity-ARCore DepthMode: 0 2022/01/27 15:17:30.741 2980 11647 Verbose Unity-ARCore InstantPlacementMode: 2 2022/01/27 15:17:30.741 2980 11647 Info native I0127 15:17:30.741420 11647 session.cc:559] Session::CheckAndWriteCurrentConfig returning OK. 2022/01/27 15:17:30.742 2980 11828 Info native I0127 15:17:30.742358 11828 android_sensors.cc:51] Gyro min delay 2.404ms requesting 5ms 2022/01/27 15:17:30.742 2980 11802 Info native I0127 15:17:30.742697 11802 camera_ndk_wrapper.cc:27] Loading Android NDK 28 symbols from libcamera2ndk.so 2022/01/27 15:17:30.743 2980 11802 Info native I0127 15:17:30.743185 11802 camera_ndk_wrapper.cc:47] Successfully loaded Android NDK 28 libcamera2ndk.so symbols. 2022/01/27 15:17:30.747 2980 11647 Info tflite Replacing 69 node(s) with delegate (TfLiteXNNPackDelegate) node, yielding 3 partitions. 2022/01/27 15:17:30.748 2980 11828 Info native I0127 15:17:30.748502 11828 android_sensors.cc:51] Accel min delay 2.404ms requesting 5ms 2022/01/27 15:17:30.748 2980 11647 Info native I0127 15:17:30.748968 11647 pursuit_tracker.cc:1516] AugmentedRegion config changed, enabled:1, quad:false, downsample:true, global reacquisition:false, lite mode:false, adaptive frame delay:false, interpolation:true, feature match stats:false, sharpness score computation:false, enable_pursuit_higher_frequent_reacquisition_on_roi:false, enable_profiling:false 2022/01/27 15:17:30.750 2980 11647 Info native I0127 15:17:30.750021 11647 session.cc:3330] Update Frame Delay to 3 frames. 2022/01/27 15:17:30.750 2980 11874 Warn native W0127 15:17:30.750357 11874 motion_analysis_calculator.cc:380] No input video header found. Downstream calculators expecting video headers are likely to fail. 2022/01/27 15:17:30.817 2980 11647 Error Unity NullReferenceException: Object reference not set to an instance of an object. 2022/01/27 15:17:30.817 2980 11647 Error Unity at ReticleBehaviour.Update () [0x00000] in <00000000000000000000000000000000>:0 2022/01/27 15:17:30.817 2980 11647 Error Unity 2022/01/27 15:17:30.822 2980 11647 Debug Unity [EGL] Request: ES 3.0 RGBA32 8888 24/8 2022/01/27 15:17:30.822 2980 11647 Debug Unity [EGL] Found: ID[11] ES 3.0 RGBA32 8888 24/8 2022/01/27 15:17:30.845 2980 11802 Info native I0127 15:17:30.845736 11802 logger.h:28] CameraMetrics: CreateCaptureSession: 102.528698ms 2022/01/27 15:17:30.846 2980 11802 Info native I0127 15:17:30.846456 11802 capture_request_utils.cc:207] Flash: ConfigureRequestFlashMode - OFF 2022/01/27 15:17:30.847 2980 11802 Info native I0127 15:17:30.847401 11802 logger.h:28] DataSourceMetrics: kFirstGlCallback: 190.645312ms 2022/01/27 15:17:30.847 2980 11769 Info native I0127 15:17:30.847416 11769 cameras.cc:1386] Camera 0 changed state CLOSED->OPEN; Camera device opened successfully. i=0 2022/01/27 15:17:30.847 2980 11769 Info native I0127 15:17:30.847500 11769 cameras.cc:1386] Camera 0 changed state OPEN->CAPTURING; Started capture session. i=1 2022/01/27 15:17:30.847 2980 11802 Info native I0127 15:17:30.847528 11802 capture_request_utils.cc:207] Flash: ConfigureRequestFlashMode - OFF 2022/01/27 15:17:30.848 2980 11647 Error Unity NullReferenceException: Object reference not set to an instance of an object. 2022/01/27 15:17:30.848 2980 11647 Error Unity at ReticleBehaviour.Update () [0x00000] in <00000000000000000000000000000000>:0 2022/01/27 15:17:30.848 2980 11647 Error Unity 2022/01/27 15:17:30.851 2980 11769 Info native I0127 15:17:30.851514 11769 cameras.cc:1386] Camera 0 changed state CAPTURING->RECONFIGURING; Changing runtime configuration... i=2 2022/01/27 15:17:30.922 2980 11647 Error Unity NullReferenceException: Object reference not set to an instance of an object. 2022/01/27 15:17:30.922 2980 11647 Error Unity at ReticleBehaviour.Update () [0x00000] in <00000000000000000000000000000000>:0 2022/01/27 15:17:30.922 2980 11647 Error Unity 2022/01/27 15:17:30.990 2980 11647 Error Unity NullReferenceException: Object reference not set to an instance of an object. 2022/01/27 15:17:30.990 2980 11647 Error Unity at ReticleBehaviour.Update () [0x00000] in <00000000000000000000000000000000>:0 2022/01/27 15:17:30.990 2980 11647 Error Unity 2022/01/27 15:17:31.059 2980 11647 Error Unity NullReferenceException: Object reference not set to an instance of an object. 2022/01/27 15:17:31.059 2980 11647 Error Unity at ReticleBehaviour.Update () [0x00000] in <00000000000000000000000000000000>:0 2022/01/27 15:17:31.059 2980 11647 Error Unity 2022/01/27 15:17:31.128 2980 11647 Error Unity NullReferenceException: Object reference not set to an instance of an object. 2022/01/27 15:17:31.128 2980 11647 Error Unity at ReticleBehaviour.Update () [0x00000] in <00000000000000000000000000000000>:0 2022/01/27 15:17:31.128 2980 11647 Error Unity 2022/01/27 15:17:31.133 2980 11634 Info CameraManagerGlobal Camera 0 facing CAMERA_FACING_BACK state now CAMERA_STATE_ACTIVE for client com.DefaultCompany.DriveARComplete API Level 2 2022/01/27 15:17:31.152 2980 11831 Info native I0127 15:17:31.152438 11831 logger.h:28] CameraMetrics: FirstCaptureComplete: 304.878385ms 2022/01/27 15:17:31.152 2980 11831 Info native I0127 15:17:31.152590 11831 android_camera.cc:1627] [Camera=0; State=RECONFIGURING] Camera completed repeating capture sequence 0 2022/01/27 15:17:31.152 2980 11831 Info native I0127 15:17:31.152622 11831 logger.h:28] CameraMetrics: LastCaptureComplete: 0 2022/01/27 15:17:31.152 2980 11769 Info native I0127 15:17:31.152709 11769 cameras.cc:1386] Camera 0 changed state RECONFIGURING->CAPTURING; [Camera=0; State=RECONFIGURING] Camera reconfigure complete. i=3 2022/01/27 15:17:31.153 2980 11647 Error Unity NullReferenceException: Object reference not set to an instance of an object. 2022/01/27 15:17:31.153 2980 11647 Error Unity at ReticleBehaviour.Update () [0x00000] in <00000000000000000000000000000000>:0 ... it continues until the NullReferenceException is the only log output.

Yes, I finally did there has been logical errors made by the developer. Two modifications needed to be done.

  1. In DrivingSurfaceManager.cs private void Start() { PlaneManager = GetComponent<ARPlaneManager>(); RaycastManager = GetComponent<ARRaycastManager>(); } Update the start with reference the Raycast Manager this will make the reticle function as intended.
  2. (Might be options) If the PackageSpawner.cs is causing some error. Make another class and paste the code in it. and Attack to an empty game object in the scene hierarchy.

managoy avatar Apr 13 '22 10:04 managoy

Thank you so much! Now the reticle can move on the plane. I have made both two modifications but the game still can't run. There is an error in 'CarBehaviour.cs'.

NullReferenceException: Object reference not set to an instance of an object CarBehaviour.Update () (at Assets/Starter Package/CarBehaviour.cs:30)

Is that the right way to set up the 'Car Manager' script? How can I fix this bug?

GPROWIRELESS avatar Apr 14 '22 01:04 GPROWIRELESS

Thank you so much! Now the reticle can move on the plane. I have made both two modifications but the game still can't run. There is an error in 'CarBehaviour.cs'.

NullReferenceException: Object reference not set to an instance of an object CarBehaviour.Update () (at Assets/Starter Package/CarBehaviour.cs:30)

Is that the right way to set up the 'Car Manager' script? How can I fix this bug?

Give me second let me check line 30 in CarBehaviour.cs

managoy avatar Apr 14 '22 01:04 managoy

Sorry I forget the picture image

GPROWIRELESS avatar Apr 14 '22 01:04 GPROWIRELESS

Thank you so much! Now the reticle can move on the plane. I have made both two modifications but the game still can't run. There is an error in 'CarBehaviour.cs'.

NullReferenceException: Object reference not set to an instance of an object CarBehaviour.Update () (at Assets/Starter Package/CarBehaviour.cs:30)

Is that the right way to set up the 'Car Manager' script? How can I fix this bug?

It looks like you haven't dragged the Reticle Prefab from the Scene hierarchy, just referencing will work.

managoy avatar Apr 14 '22 01:04 managoy

Sorry I forget the picture image

you don't need to add car behaivour, just keep it empty or none

managoy avatar Apr 14 '22 01:04 managoy

Sorry I forget the picture image

Check This link for full unity package: https://drive.google.com/drive/folders/1iX2V9fZpugsu2NxH3H8tlzGePd1EBND4?usp=sharing

managoy avatar Apr 14 '22 01:04 managoy

Thank you very much! I have run the game successfully. I'm curious about the plane spawned in the game. Can I use a fixed plane to replace it?

GPROWIRELESS avatar Apr 14 '22 02:04 GPROWIRELESS

Thank you very much! I have run the game successfully. I'm curious about the plane spawned in the game. Can I use a fixed plane to replace it?

Yes, sure. Play different things and you can reach out whenever. Have a good day. 😄

managoy avatar Apr 14 '22 02:04 managoy

@managoy

2.(Might be options) If the PackageSpawner.cs is causing some error. Make another class and paste the code in it. and Attack to an empty game object in the scene hierarchy.

You just need to rename the PackageSpawner.cs, i don't know why, but they named the Class PackageManager in the Script.

And thanks a lot for the Point with the Raycastmanager :)

YSpadin avatar Apr 27 '22 22:04 YSpadin

@managoy

2.(Might be options) If the PackageSpawner.cs is causing some error. Make another class and paste the code in it. and Attack to an empty game object in the scene hierarchy.

You just need to rename the PackageSpawner.cs, i don't know why, but they named the Class PackageManager in the Script.

And thanks a lot for the Point with the Raycastmanager :)

Sure, no problem 😊

managoy avatar Apr 28 '22 02:04 managoy

Please tell me what script I need to write in PackageBehaviour.cs ?

VICOO4IK avatar May 07 '22 22:05 VICOO4IK

I still have the problem with the reticle. It seems to be just stuck at a point.

Mr3lueSky avatar Aug 05 '22 16:08 Mr3lueSky

I still have the problem with the reticle. It seems to be just stuck at a point.

There was a typo of not initializing some component variables in the Start. I forget exactly what it was. I think I have Gave replies with full functional codes. Please check those.🙃

managoy avatar Aug 05 '22 16:08 managoy

I still have the problem with the reticle. It seems to be just stuck at a point.

Check This link for full unity package: https://drive.google.com/drive/folders/1iX2V9fZpugsu2NxH3H8tlzGePd1EBND4?usp=sharing

managoy avatar Aug 05 '22 16:08 managoy