I’m getting this message:
Assertion failed: Assertion failed on expression: ‘CompareApproximately(SqrMagnitude(result), 1.0F)’
0x00000001414EF709 (Unity) StackWalker::GetCurrentCallstack
0x00000001414F5D16 (Unity) StackWalker::ShowCallstack
0x000000014138EB8B (Unity) GetStacktrace
0x000000014088939C (Unity) DebugStringToFile
0x00000001408A3C4C (Unity) EulerToQuaternion
0x0000000141FA0B08 (Unity) Quaternion_CUSTOM_Internal_FromEulerRad_Injected
0x00000000414E18B7 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.Quaternion:Internal_FromEulerRad_Injected (UnityEngine.Vector3&,UnityEngine.Quaternion&)
0x00000000414E1743 (Mono JIT Code) UnityEngine.Quaternion:Internal_FromEulerRad (UnityEngine.Vector3)
0x00000000414E15CB (Mono JIT Code) [Quaternion.cs:184] UnityEngine.Quaternion:Euler (single,single,single)
0x00000000414E5953 (Mono JIT Code) [RoadBuilder.cs:168] Casablanca.RoadBuilder:Build (int,UnityEngine.Transform,UnityEngine.Material[ ],UnityEngine.Material[ ],UnityEngine.Material[ ],int,single,single,single,single)
0x00000000414E3983 (Mono JIT Code) [RoadBuilder.cs:110] Casablanca.RoadBuilder:Awake ()
0x0000000042FCD618 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007FF98462A1AB (mono-2.0-bdwgc) [mini-runtime.c:2809] mono_jit_runtime_invoke
0x00007FF9845B1A42 (mono-2.0-bdwgc) [object.c:2915] do_runtime_invoke
0x00007FF9845BAA2F (mono-2.0-bdwgc) [object.c:2962] mono_runtime_invoke
0x0000000140BDE81A (Unity) scripting_method_invoke
0x0000000140BD7390 (Unity) ScriptingInvocation::Invoke
0x0000000140BD744E (Unity) ScriptingInvocation::InvokeChecked
0x0000000140B8CFAC (Unity) MonoBehaviour::CallMethodInactive
0x0000000140B8CB44 (Unity) MonoBehaviour::CallAwake
0x0000000140B8C128 (Unity) MonoBehaviour::AddToManager
0x0000000140B8C757 (Unity) MonoBehaviour::AwakeFromLoad
0x0000000140C473B1 (Unity) AwakeFromLoadQueue::InvokePersistentManagerAwake
0x0000000140C49E19 (Unity) AwakeFromLoadQueue::persistentManagerAwakeFromLoad
0x00000001409B385C (Unity) LoadSceneOperation::CompleteAwakeSequence
0x00000001409B451B (Unity) LoadSceneOperation::IntegrateMainThread
0x00000001409B7A6B (Unity) PreloadManager::UpdatePreloadingSingleStep
0x00000001409B86D9 (Unity) PreloadManager::WaitForAllAsyncOperationsToComplete
0x0000000140E4764F (Unity) EditorSceneManager::RestoreSceneBackups
0x00000001413B9C02 (Unity) PlayerLoopController::EnterPlayMode
0x00000001413C5D78 (Unity) PlayerLoopController::SetIsPlaying
0x00000001413C969D (Unity) Application::TickTimer
0x00000001415C370D (Unity) MainMessageLoop
0x00000001415C59FC (Unity) WinMain
0x000000014271FD27 (Unity) __scrt_common_main_seh
0x00007FF9D5671FE4 (KERNEL32) BaseThreadInitThunk
0x00007FF9D745F061 (ntdll) RtlUserThreadStart
The line responsible for this is:
Quaternion sangle = Quaternion.Euler(pitchAngle/blocks,turnAngle/blocks,0);
I don’t know the values of these variables when the exception is thrown but I’m sure the value of **blocks**
is an integer greater than zero. In the official documentation there’s no mention of certain range of values that could cause problems, but obviously there are values that cause Quaterinion.Euler to misbehave. I don’t know why this is happening, the answer is hidden on line 184 of Quaternion.cs, but I don’t have access to Unity’s source code so I’m clueless. I’m using 2018.1.0f1. Any information on the subject will be appreciated, thank you!