Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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 drak8888 · Nov 30, 2013 at 07:48 PM · crashexecutableiskinematicdestructible

isKinematic = false makes unity executable crash

So here's the thing. I'm making a destructible house that when you click on parts of it, chunks get removed and fly around. It works perfectly in the editor, it flys around and looks a bit like Age of Empire 3 (which is GOOD).

Problem is, every piece is set to isKinematic = true at startup and I give the isKinematic = false with a script to unlodge them and make them fly around. Like I said, in the editor it works, but the second I do that in an executable BAM it crashes and gives me this pretty little log :

 Unity Player [version: Unity 4.3.0f4_e01000627d60]
 
 GoC2.exe caused an Access Violation (0xc0000005)
   in module GoC2.exe at 0033:80509e3c.
 
 Error occurred at 2013-11-30_143026.
 D:\Projets\God of Chaos 2\Exec\GoC2.exe, run by Fel.
 20% memory in use.
 16282 MB physical memory [12882 MB free].
 18714 MB paging file [14299 MB free].
 134217728 MB user address space [134217323 MB free].
 Read from location ffffffff caused an access violation.
 
 Context:
 RDI:    0x02916520  RSI: 0x00000000  RAX:   0x00000002
 RBX:    0x0f3247a8  RCX: 0x00000006  RDX:   0x00000009
 RIP:    0x80509e3c  RBP: 0x00000000  SegCs: 0x00000033
 EFlags: 0x00010202  RSP: 0x00adefc0  SegSs: 0x0000002b
 R8:    0x00000003  R9: 0x029318dc  R10:   0xe0000000
 R11:    0x00adef80  R12: 0x00000008  R13:   0x00000000
 R14:    0x02a0e718  R15: 0x029c7460
 
 Bytes at CS:EIP:
 0f 54 8c 24 88 01 00 00 44 0f 54 9c 24 88 01 00 Module 1
 C:\WINDOWS\SYSTEM32\xinput1_3.dll
 Image Base: 0x00400000  Image Size: 0x0001e000
 File Size:  107368      File Time:  2007-04-04_185422
 Version:
    Company:    Microsoft Corporation
    Product:    Microsoft® DirectX for Windows®
    FileDesc:   Microsoft Common Controller API
    FileVer:    9.18.944.0
    ProdVer:    9.18.944.0
 
 
 == [end of error.log] ==

So, I have Unity free and no plugins whatsoever, just pure javascript and 3ds max models with textures and a terrain. When I remove that kinematic line from my code it works in the executable but well, the chunks don't get removed which is pretty dumb and not what I want at all.

Should I file an error report directly to Unity or am I doing something wrong here?

Comment
Add comment · Show 1
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 drak8888 · Dec 02, 2013 at 07:23 PM 0
Share

Anyone? Pleease?

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by davedev · Dec 02, 2013 at 08:27 PM

I don't know enough to help specifically, but I'd find exactly where in your code the application crashes. For example, is it when when game object load, get drawn to the screen, when the code hits one of your kinematic objects, or when it hits something related to your objects. If you find that you might be able to program around it or it might give more info for resolving rather than the error log.

Comment
Add comment · Show 8 · 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 drak8888 · Dec 02, 2013 at 09:41 PM 0
Share

Its exactly the line with "is$$anonymous$$inematic = false" that crashes. Precisely that line.

avatar image drak8888 · Dec 02, 2013 at 09:43 PM 0
Share
 var radius = 5.0;
 var power = 10.0;
 function Start () {
     // Applies an explosion force to all nearby rigidbodies
     var explosionPos : Vector3 = transform.position;
     var colliders : Collider[] = Physics.OverlapSphere (explosionPos, radius);
     var colliders$$anonymous$$inematic : Collider[] = Physics.OverlapSphere (explosionPos, radius/8);
     
     for (var hit : Collider in colliders$$anonymous$$inematic) {
         if (hit && hit.rigidbody){
             hit.rigidbody.is$$anonymous$$inematic = false; // RIGHT HERE
         }
     }
     for (var hit : Collider in colliders) {
         if (hit && hit.rigidbody){
             hit.rigidbody.AddExplosionForce(power, explosionPos, radius, 3.0);
         }
     }
     
 
 }
avatar image davedev · Dec 02, 2013 at 10:05 PM 0
Share

Ah ok. Like I said, I've never encountered this specifically. Why are you disabling the physics? What you've done seems like it should work in theory, but in several physics engines I've had issues with turning physics on and off so usually I have either two copies of the object for things like allowing user dragging AND physics or I coerce physics into doing what I want such as using force to achieve what I want to do by turning physics off.

avatar image drak8888 · Dec 02, 2013 at 10:16 PM 0
Share

Well what I have is a house with frozen chunks (Physics disabled). When an explosion is set upon the house, the physics of chunks around a certain radius of the explosion are turned on and then applied a force to send them flying. Like I said, it works fine in the editor. But in the executable it just gives me that annoying Access Violation. I tried disabling them in another way, like constraining them while leaving the physics on but it starts lagging terribly.

avatar image davedev · Dec 02, 2013 at 10:48 PM 0
Share

Just some thoughts. You might want to move your code to a FixedUpdate handler ins$$anonymous$$d of Start. Physics behaviors work better in fixed update and sometimes hicky things can happen in Start functions/first frame like from not everything being really initialized.

The other thing you could do is build your house with non-rigidboy chunks and then swap them at explosion time with rigid body versions using moveTo and then explode away.

Show more comments
avatar image
0

Answer by niall1111 · Sep 17, 2014 at 06:53 PM

That's quite an old version of Unity, why not upgrade to the latest (4.5.3 I believe) and see if that fixes your problem? There's a good chance that if this is a bug, it's been fixed in the dozens of versions between yours and the current one. :)

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 tanoshimi · Sep 17, 2014 at 07:11 PM 0
Share

Quite an old version of Unity, because it's quite an old question...

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.

Follow this Question

Answers Answers and Comments

19 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

Related Questions

My build crashes when I try to load a certain level, but works fine in the editor 2 Answers

Unity Crash - Access Violation (0xc0000005) error 1 Answer

LoadLevelAsync Causes Unity to Crash? 1 Answer

Unity 4.2 crash when editor recompiles project 1 Answer

Unity 4.2 IOS Exception Handling 0 Answers


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