Post not yet marked as solved
I'm using multipeer connectivity to synchronize between several devices connected through Wifi the movement of nodes in a 3D SceneKit environnement.
The node movement is calculated on the master device and sent to the ***** devices which then set the node to the position received. The movement is sent via the renderer loop of the SceneView of the master, and through a data stream opened with each ***** and managed with the MultipeerConnectivity framework.
The video here - https://stackoverflow.com/questions/63853707/multipeer-connectivity-data-stream-issue-over-wifi shows the result, and the issue which is the jittering of the ball on the ***** (right) due to a regular pause every 0.6-0.7 second in the reception of the data through the stream. The counter on the upper left shows that no packet is lost. There is also no issue with the integrity of the data received.
This very regular pause on the slaves is not present in the simulator but only when it runs on real devices, and whatever the devices (iPhone or Ipad, old or recent).
Is there a way to find out what can cause this regular pause on the slaves devices ?
Would it make sense to have the input stream on the slaves executed on a dedicated thread/runloop instead of the runloop of the main thread ?
Post not yet marked as solved
I'm doing a game which is a boardgame with characters moving on a chess like board in 3D using SceneKit.The nodes tree is defined as follow :rootNode <-- GameRotationNode <-- GameBoardNode <-- GameNode 1...GameNode XAll GameNodes are direct children of GameBoardNode.GamesNodes are either static or moving nodes. All static GameNodes have either static or no physicsbody. Moving GameNodes have dynamic physicsbody.I'm applying a constant rotation through the Y axis to the whole game board with the following codelet Action = SCNAction.repeatForever(SCNAction.rotateBy(x: 0, y: degreesToRadians(Degres: 90), z: 0, duration: 5))GameRotationNode.runAction(Action)My issue is that the GameNodes with dynamic physicsbody are not rotating like the rest of the GameNodes. Everything else is rotating.If I change the physicsbody of the moving GameNodes to static or none, then they rotate also...but I need the dynamic physicsbody on those ones.Is this a limitation of physicsbody management of SceneKit?Or are there other ways to achieve what I want?Thx,J.
Post not yet marked as solved
I want to do the following on a node which is a simple sphere, without a physicsbody, created in the scenekit editor : let ScaleDown = SCNAction.scale(to: 0, duration: 1) let ScaleUp = SCNAction.scale(to: 0.4, duration: 2) let Move = SCNAction.move(to: SCNVector3.init(InitialCharacterGridCoordinates.x, 0, InitialCharacterGridCoordinates.y), duration: 0) CharacterNode.runAction(SCNAction.sequence([ScaleDown, Move, ScaleUp]))The problem is that the Move action doesn't do anything. However if I do as below it works : CharacterNode.runAction(SCNAction.sequence([Move, ScaleDown, ScaleUp]))I have also tried with all types of physicsbody, it does not work neither. It seems that as soon as a scale action is executed, the move action is not working, when in a sequence. Outside of a sequence, like below it is working but not really clean code.CharacterNode.runAction(ScaleDown, completionHandler: { self.CharacterNode.runAction(Move, completionHandler: { self.CharacterNode.runAction(ScaleUp) }) })Any idea why the sequence of action does not work ?J.