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.
Oh, sorry, I don’t have access to google drive because I’ve got strict internet rules. I might try to reproduce it myself and I’ll tell you if I find anything.
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.
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:
The game starts
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.
Then you fire the gun
This spawns the “blank” object and you “On Update” will start checking for collisions on the spawned object
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.
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.
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.
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.