Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

unity c# throw exception

//usual c# syntax should work
throw new Exception(); //remember to include 'using System;'
//alternatively, try this
Debug.LogException(e, this);

//docs for latter: https://docs.unity3d.com/ScriptReference/Debug.LogException.html
Source by forum.unity.com #
 
PREVIOUS NEXT
Tagged: #unity #throw #exception
ADD COMMENT
Topic
Name
1+2 =