英文:
Make a slow drifting motion for a physics group phaser.js
问题
我有一个物理组,速度非常低,就像child.setVelocity(1, 10);
。如果这个组的子物体因更快的组碰撞而加速,那没关系,但我希望它们非常缓慢,基本上不受重力影响,但仍然移动,不会因下落而加速,有没有办法做到这一点?
英文:
So I have a physics group, with a very low velocity like child.setVelocity(1, 10);
It's fine if this groups children speed up from a faster group collision, but I would like them to be very slow, basically unaffected by gravity but still moving, not speeding up by falling down, is there anyway to do that?
答案1
得分: 1
你可以使用函数 gameobject.setAllowGravity(false)
来关闭一个游戏对象的重力。文档链接。
或者如果你在一个物理组中使用它,你可以使用属性 allowGravity
并将其设置为 false
。文档链接。
英文:
You can turn of the gravity of one gameobject with the fucntion gameobject.setAllowGravity(false)
link to the documentation.
Or if you are using it in a physics group, you can use the property allowGravity
and set it to false
.
link to the documentation
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论