- Home /
Unity Script causing crash
I have been going over this code again and again and cant find what would cause a crash like this, In the script after pressing a key a rigidbody is added too each goo object and pressing it again will cause them to lerp back into position, however, the game crashes sometimes right in the middle of this action, the error log shows the eroor: Unity.exe caused an Access Violation (0xc0000005). I just have no damn clue how this could happen
EDIT: Unity has recognized this as a bug and is working towards a resolution apparently, I just got this email
"Hello,
Thank you for your submission, We have been able to reproduce this bug and have sent it for resolution with our developers. We cannot say when the resolution will be publicly available.
We highly appreciate your contribution. If you have further questions, feel free to contact us.
Regards, Jonas Unity QA Team"
I have a similar problem in one of my games, where if you shoot your 5th bullet out of the pistol (the bullets did have rigidbodies applied to them), the character controller deletes itself from the gameworld, even though nowhere in the script does it do that. The physics engine is very complicated, and I decided that it was a glitch. This was on Unity 4.2, and I have been to lazy to update it, so it might help to download the newest version if you are not using that already. Otherwise, I would report it via the bug reporter.
Answer by ironblock · Jul 24, 2014 at 07:36 AM
IEnumerator lerp(){
foreach(GameObject i in RigidGoobjects)
{
i.transform.position = Vector3.MoveTowards(i.transform.position, i.transform.parent.position, 0.5f);
}
yield return new WaitForSeconds(0.01f);
}
your co routine was way to fast this wil fix it
Nope, It doesn't matter, I have tested it without a WaitForSeconds there and still get the same crash, I also tested it with WaitForSeconds(0.01f), same crash
In fact, I just replaced it with a void method, still have the same crash
Your answer
Follow this Question
Related Questions
Advice for Intersecting Colliders 0 Answers
Addforce - bug with jump 2 Answers
Rigidbody2D won't stop moving. 2 Answers
Unity 4.0 Crashes without reason 1 Answer
A node in a childnode? 1 Answer