phy_fixed_rotation

此变量可用于设置实例是否受旋转力的影响 (默认为 false)。如果设置为 true,则任何外力 (来自代码的脉冲或力,或来自碰撞) 都不会影响实例的旋转值,并且必须使用 phy_rotation 变量手动设置此值

 

语法:

phy_fixed_rotation;

 

返回:

Boolean (or undefined if the instance is not physics enabled)

 

例子:

phy_rotation = 0;
phy_fixed_rotation = true;

以上代码将实例切换为具有固定旋转,然后设置旋转角度。