• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Tohron · Feb 16, 2017 at 06:27 PM · vrcrashcolliding

Access Violation Crash in Compiled VR game on projectile hit

I have a bug in my Vive VR game where in the executable version of the game, there is an Access Violation crash whenever a projectile hits an enemy. Everything works fine when I run it in the Unity Editor. I submitted a bug report two weeks ago (viewable here), but there's still been no response whatsoever.

What should I do now? The game is essentially unplayable, I have no idea what's causing it, no idea if or when I'll get a response from the Unity support staff, and since it runs fine in the editor, my debugging capabilities are very limited.

Incidentally, my projectile collision code is:

 void OnTriggerEnter(Collider other)
     {
         //print(other.tag);
         if (other.tag == "nodeSphere" || other.tag == "exclusionZone")
             return;
         if (other.tag == "enemy")
         {
             Enemy eScript = other.gameObject.GetComponent<Enemy>();
             if (eScript == null)
             {
                 Subcollider subScript = other.gameObject.GetComponent<Subcollider>();
                 eScript = subScript.parentObject;
             }
             eScript.TakeDamage(damage);
 
         }
 
         if (hitObject)
         {
             Instantiate(hitObject, transform.position, transform.rotation);
         }
         Destroy(this.gameObject);
     }

The hit object itself does not cause the crash (tested that), and if I remove the VR functionality and compile, that executable version does not crash when projectiles collide.

So again, what should I do now, since I've had no response from Unity support after waiting two weeks? Is this a problem with the SteamVR plugin (in which case I should contact HTC or Valve)? If you actually have a solution to the problem, that would be welcome too! Thanks!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by BlueOctave · Feb 17, 2017 at 08:30 AM

Hi there, a lot of times Access Violations occur when a script's class name differs from the file's name. Perhaps your, "Enemy" class name is not "Enemy.cs" or perhaps there is an issue with some of the Vive's API scripts that conflict with your class.

My suggestion would be to change your Enemy class and file name to something like, "EnemyBehaviour". It's a shot in the dark, but I hope it sheds some light.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Tohron · Feb 17, 2017 at 07:25 PM 0
Share

Tried that, didn't work, unfortunately.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

67 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Switching VR platforms via VRSettings 0 Answers

Build crashes with error GameAssembly.dll caused a Breakpoint (0x80000003) 1 Answer

[Crash] Unity with GearVR can crash after allowing permissions after first installation 1 Answer

DictationRecognizer : catch "Dictation support is not enabled on this device" 0 Answers

Unity 5.3.4p6 Android VR Crash on Start 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges