I’ve noted that using “rotateRelZ()” on the positionMatrix of a component doesn’t function when adding a physics entity. Simply removing the physics entity will make it function again.
It looks like it’s because in In Physics mode, the object’s coordinates are refreshed in real time by the physical world so that the physical world can figure out in real time the real time position of the object when it is subjected to physical quantities, in this case the means of manually assigning a value to it doesn’t work successfully, so if that’s important to you I’d suggest changing it to:
def RotateComponentZAxis(component,angle):
posMatrix = component.PositionMatrix
phy.PhysicsType = 1
for i in range (1,angle+1):
posMatrix.rotateRelZ(1)
delay(0.01)
component.PositionMatrix = posMatrix
phy.PhysicsType = 0
This will apply to certain rotations that are not in the falling case.