Skip to content

Commit

Permalink
Update rigidbody.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Snoroz authored Nov 3, 2023
1 parent f521596 commit a0df0e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ursina/rigidbody.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def __init__(self, world, shape, entity=None, mass=0, friction=.5, mask=0x1):
self.collision_node = BulletRigidBodyNode('Rigidbody')
self.collision_node.setMass(mass)
self.collision_node.setFriction(friction)
if entity != None:
if entity:
self.node_path = entity.getParent().attachNewNode(self.collision_node)
else:
self.node_path = self.attachNewNode(self.collision_node)
Expand All @@ -76,7 +76,7 @@ def __init__(self, world, shape, entity=None, mass=0, friction=.5, mask=0x1):
self.node_path.node().addShape(_convert_shape(s), TransformState.makePos(s.center))

self.node_path.node().setIntoCollideMask(BitMask32(mask))
if entity != None:
if entity:
entity.reparentTo(self.node_path)
self.node_path.setPos(entity.position)
entity.position = shape.center
Expand Down

0 comments on commit a0df0e6

Please sign in to comment.