- Home /
Raycast Error in Built Game
The game runs fine in the editor, but when I build and run it it crashes. The error given in the dump file is "The thread tried to read from or write to a virtual address for which it does not have the appropriate access" According to Google, this is caused by .NET 2.0 code attempting to read/write to memory that it isn't supposed to. By commenting/un-commenting code out until the game works, I have identified the problem down to the line:
Physics.Raycast(transform.position, c.transform.position - transform.position, out hitInfo)where 'c' is a collider and 'hitInfo' is
RaycastHit hitInfo = new RaycastHit();Remember that the game works perfectly in the editor, it's just when I build it that the error occurs. Does anybody have any suggestions please? :)
What version of unity are you using?
Are you spawning your own threads?
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Why am I getting the Unity failed to run reference rewriter whenever I attempt to build my game? 2 Answers
WindowsPlayer Error when building project 1 Answer
Build failed with errors at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer 0 Answers
Can't build my android project 1 Answer