How to rotate bones?

Is there currently a way I can rotate bones with javascript? I’d like to be able to make a character look at a point in space.


Model bone hierarchies are converted into GraphNodes. You search these like the Entity hierarchy. You get the model hierarchy from the model in the model component;

var modelComponent = this.entity.model;
var model = modelComponent.model;
var graph = model.getGraph();
var bone = graph.findByName("Bone Name");

bone is instance of pc.scene.GraphNode. So you can use methods to rotate, and lookAt, etc.