diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-12-04 10:56:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-04 10:56:39 +0100 |
commit | 3a889f26844d6171c911d31eace9afeab38dac1f (patch) | |
tree | 5532ed004f76107f138ec4902b30bbc32c723a6f /modules | |
parent | 83a5c808ab3567a4267c10040092f0358e064969 (diff) | |
parent | 3aeeaa9318e6d5e15ee26b16ebd516e1100c3142 (diff) |
Merge pull request #24140 from aroncds/master
Fix csgshape collider without object id
Diffstat (limited to 'modules')
-rw-r--r-- | modules/csg/csg_shape.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp index a4c34e7583..4e35014459 100644 --- a/modules/csg/csg_shape.cpp +++ b/modules/csg/csg_shape.cpp @@ -47,6 +47,7 @@ void CSGShape::set_use_collision(bool p_enable) { PhysicsServer::get_singleton()->body_set_state(root_collision_instance, PhysicsServer::BODY_STATE_TRANSFORM, get_global_transform()); PhysicsServer::get_singleton()->body_add_shape(root_collision_instance, root_collision_shape->get_rid()); PhysicsServer::get_singleton()->body_set_space(root_collision_instance, get_world()->get_space()); + PhysicsServer::get_singleton()->body_attach_object_instance_id(root_collision_instance, get_instance_id()); _make_dirty(); //force update } else { PhysicsServer::get_singleton()->free(root_collision_instance); @@ -468,6 +469,7 @@ void CSGShape::_notification(int p_what) { PhysicsServer::get_singleton()->body_set_state(root_collision_instance, PhysicsServer::BODY_STATE_TRANSFORM, get_global_transform()); PhysicsServer::get_singleton()->body_add_shape(root_collision_instance, root_collision_shape->get_rid()); PhysicsServer::get_singleton()->body_set_space(root_collision_instance, get_world()->get_space()); + PhysicsServer::get_singleton()->body_attach_object_instance_id(root_collision_instance, get_instance_id()); } _make_dirty(); |