Parent added meshes to the parent node instead of creating a group

This requires a small change in PlatformPhysics, or otherwise the added mesh would still drop down.
This commit is contained in:
fieldOfView 2018-03-16 13:22:43 +01:00
parent 8e26d27e80
commit 83168886d6
2 changed files with 5 additions and 38 deletions

View file

@ -71,7 +71,7 @@ class PlatformPhysics:
# Move it downwards if bottom is above platform
move_vector = Vector()
if Preferences.getInstance().getValue("physics/automatic_drop_down") and not (node.getParent() and node.getParent().callDecoration("isGroup")) and node.isEnabled(): #If an object is grouped, don't move it down
if Preferences.getInstance().getValue("physics/automatic_drop_down") and not (node.getParent() and node.getParent().callDecoration("isGroup") or node.getParent() != root) and node.isEnabled(): #If an object is grouped, don't move it down
z_offset = node.callDecoration("getZOffset") if node.getDecorator(ZOffsetDecorator.ZOffsetDecorator) else 0
move_vector = move_vector.set(y = -bbox.bottom + z_offset)