0

I have an ARSKView scene containing some SKLabelNode items. The result can be seen here: https://sendvid.com/35ded50d

I want to write some code that loops over all of the nodes 60 times per second and updates their position. I don't want to use SKAction to move the nodes over time, I just want to set their 3D position to a specific value. How do I do this?

Some related questions:

Move SKSpriteNode by Y - Swift 2 + SpriteKit

How do I programmatically move an ARAnchor?

But these questions don't seem to give a clear, simple answer to "How do I update the 3D position of an SKNode programmatically 60 times per second?"

Note that setting the .position property doesn't seem to work. It doesn't do anything.

rmaddy
  • 314,917
  • 42
  • 532
  • 579

1 Answers1

0

Destroy and re-create the ARAnchor associated with an SKNode. Set the new ARAnchor to the position you want to move the node to.

Note that you do not need to remove or recreate the SKNode itself. Just return the already-existing SKNode in the ARSKViewDelegate.