I am trying to script the animation of a robot arm, but access to model rigging doesn't seem to be documented

I have a rigged model of a robot arm that I want to animate within the physics engine to perform some simple tasks (picking up objects etc). I have a model that is rigged up properly (I hope), and it has a rigidbody and collision mapping, but I can’t seem to expose access to the individual bone movement. I could tell you what I’ve tried already, but I’ve just been stabbing around in the dark messing with animations skeletons and I don’t think it would help other than to convince you that I really am stuck.

Ideally, I want to be able to ‘rotate’ the limbs of the robot arm from a script, could someone shed some light on how I’d go about doing that?

As it’s physics driven, I can point you in the right direction but can’t how to make it ‘work’.

This project will introduce you how to access the joints in the physics engine: https://playcanvas.com/project/431888/overview/ragdoll

The tough part is to work out how to drive the ‘hand’, whether it should be kinematic or dynamic and set the velocity on key up/down.

Thanks for the reply! I’m certainly a step in the right direction now, however I have a question regarding your script: In the ragdoll script, you seem to be able to get a rigid body object of a specific bone. You do this using the “findByName” method. I don’t know the names used to reference the bones of my model. So my question is: Could you tell me where they are listed, either in the entity object, or if I have to open the object in blender or something to find out.

Here’s a link to download the model I’m using, just for reference: https://sr.ht/I91w.obj

Thanks for your time!

You can use a modelling package to find out what part is named what or you can print out all the children graph nodes recursively of the entity that has the model component to the console and hope they are named in a logical way. (I do this a lot to debug a scene when something doesn’t quite make sense).