SKFieldNode magneticNode attracting forces

只谈情不闲聊 提交于 2019-11-30 07:25:00

Electric and Magnetic fields are currently broken, as of iOS 8.1. They don't interact with the physics simulation at all.

What's probably causing your other node to move is that its physics body is inside the body you've attached to your field, which the simulation corrects by moving the nodes apart.

Also of note is that if magnetic fields were working properly, you don't need to add a physics body to it - the field node itself is intended to be enough to get the effect.

I've got an open bug report filed with Apple. Filing duplicates increases a bug's priority, so if you file one, mention that it's a duplicate of bug 18785194.

UPDATE: This bug still exists in iOS 8.3/Xcode 6.3 beta 2. I've received a request for more information on my bug report, so at least somebody at Apple is aware of it, but that was four beta versions ago.

UPDATE 2: This bug is partially resolved with iOS 9.0/Xcode 7.0 beta 2. Electric and magnetic fields now work, but custom fields are still broken.

YangXiaoyu
touchField.strength = -1;  

This line will reverse your field.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!