Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

326
Vistas
SceneKit – Node with animated skeleton not moving

I have a SceneKit app with 2 .scn files in the art.scnassets folder. The base ship.scn that comes with the project, and a new file orcIdle.scn that I added myself.

When I call this code on this ship, it moves it properly:

self.myScene = SCNScene(named: "art.scnassets/ship.scn")!
// Set the scene to the view
let ship = (myScene.rootNode.childNode(withName: "ship", recursively: false))!
ship.position = SCNVector3(0, 0, -5)
self.sceneView.scene = myScene

When I call the same code on my orcIdle file, it places the orc exactly at (0,0,0)

self.myScene = SCNScene(named: "art.scnassets/orcIdle.scn")!
// Set the scene to the view
let orc = (myScene.rootNode.childNode(withName: "orcIdle", recursively: false))!
orc.position = SCNVector3(0, 0, -5)
self.sceneView.scene = myScene      

here are screenshots of the file node:

This is the default ship file included in the project by Xcode.
enter image description here

This is my orcIdle file.

enter image description here

As you can see, it's the exact same code but 1 moves, and the other doesn't. Also, in the top right corner of the images, i can adjust the Z value there. It works for .ship, but not for .orcIdle.

Is it a scale issue? Any thoughts?

Here's a new screenshot with as much of the scene graph as I can capture. enter image description here

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Usually, you must select a skeleton's top hierarchy (like root node) to move geometry, since its mesh was bound to skeleton. If model's skeleton is considerably deeper in the hierarchy use .childNodes[x] subscript syntax to fetch a desired joint.

But a solution based on your .scn file is the following – create a topNode object and put root and LOD_Group inside it.

enter image description here

So your code should look like this:

let scene = SCNScene(named: "art.scnassets/orcIdle.scn")!
    
orc = scene.rootNode.childNode(withName: "topNode", recursively: true)!
    
orc.position = SCNVector3(0,0,-20)
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda