Armory crashes when removing an object in strange circumstances [SOLVED]


#1

Hello, I’ve recently started using Armory, it’s been really fun playing around with the engine and i’ve found the Blender implementation priceless.
However, while experimenting i’ve come across an error that I haven’t been able to identificate.
Here’s a node tree that creates and shoots a projectile, when it hits something it generates an explosion and disappears


However, when the object gets removed, Armory freezes. After some trial and error i managed to aislate the source of the problem in the nodes that appear in the other node tree below.

When this seemingly unrelated nodes are deleted, the error disappears. This nodes apply a downward force on certain objects to simulate gravity, since i’m running my rigid body world without gravity. (the group is disconnected since i’m still figuring out how to apply the force to all the objects in the group)

I know i could get the desired results in other ways, but i’d like to understand why this happens so that i know how to deal with problems like this in the future.

Thanks for your attention.


#2

Could you show the output in the console, that usually gives good hints for causes of crashes.


#3

Of course, last time i didn’t realize the crash printed something:
console


#4

Does your “Collision” object have the Rigid Body physics applied to it?


#5

Yes, otherwise it crashes when executing the event, since it uses physics nodes


#6

Hmm, I haven’t seen that error yet. What version of Armory are you using? You could upload your Blend and I could look at it really quick.


#7

Armory 0.5 for Win 64bits, bundled with Blender 2.79
I’ll try to upload the .blend


#8

https://drive.google.com/open?id=1unV9kzWSawlHvnadK5rzq4y6NMepzQ--
I can’t upload directly since i’m a newbie.
Thanks for your help


#9

Oh, sorry, I don’t have access to google drive because I’ve got strict internet rules. :confused: I might try to reproduce it myself and I’ll tell you if I find anything.


#10

It may have something to do with the ‘On update’ node that feeds the logic gate, since other input methods that only run once don’t fail so consistently, but i still can’t see the relation between the ‘remove object’ and the downforce.

Anyway, tell me if you want more detailed screenshots or want me to share the .blend through mail or other means.


#11

I think I may have figured it out from your screenshot. The problem comes from the “Get Contacts” node trying to get the contacts of the deleted “blank”.

Here’s the sequence of events:

  1. The game starts
  2. On update you are trying to get the contacts of the “Object” output of the “Spawn Object” node.
    • At this point, no “blank” has been spawned so the “Object” output yields null. In this case, the “Get Contacts” node is smart enough to ignore the null object input.
  3. Then you fire the gun
    • This spawns the “blank” object and you “On Update” will start checking for collisions on the spawned object
  4. The the blank collides with something
    • Because the blank has collided with another object and its parent is right so it passes the gate, you remove the blank.
  5. On the next frame after the blank is removed, you try to check for collisions on the “Object” output of the “Spawn Object” node again.
    • This time, the object from the “Spawn Object” node doesn’t actually exist any more ( you removed it in step 4 ), and the “Get Contacts” node throws an error because of it.

Not 100% sure that is exactly what is happening, but the error in the console does indicate that the problem lies with the input to the “Get Contacts” node.


#12

Makes sense, i can work around that. I’ve seen what’s the relation between the ‘remove object’ and the downforce: it only crashes if there is another rigid body in contact with the same parent that it’s checking for collisions (without downforce the player levitates without touching the ground).
I’ll check tomorrow just in case, but i’m pretty sure i can put this as solved.


#13

Just made a set of nodes that stops checking for contacts as soon as the new event is fired and the projectile is removed, works perfectly.
Problem solved.
Thanks for helping so fast.


#14

No problem! I’m leaning so much about Armory lately, I like to be able to help people who are facing the same kinds of things that I am. :smiley: