In case an entity with a PhysicsBody is created inside another entity with PhysicsBody, the beginContact callback from PhysicsContact is triggered before the entity has been initialized (init has not been called in the script) and the entity has no entityId.
Expected behaviour :
beginContact call is deferred until the script attached to the entity has been initialized and the entityId has been assigned.
Situation where I encountered this issue :
When two entities are really close and one fires a projectile at the other, the projectile entity is created inside the other one.
In case an entity with a
PhysicsBodyis created inside another entity withPhysicsBody, thebeginContactcallback fromPhysicsContactis triggered before the entity has been initialized (inithas not been called in the script) and the entity has noentityId.Expected behaviour :
beginContactcall is deferred until the script attached to the entity has beeninitialized and theentityIdhas been assigned.Situation where I encountered this issue :
When two entities are really close and one fires a projectile at the other, the projectile entity is created inside the other one.