Hello, all.
I am trying to make some armor for a character that moves with the y axis of the camera. Here is my current setup:
var Stealyrot = pc.createScript('stealyrot');
Stealyrot.attributes.add('target2',{
type:'entity',
})
let stolenrot = new pc.Vec3();
// update code called every frame
Stealyrot.prototype.update = function(dt) {
stolenrot = this.target2.getRotation();
this.entity.setRotation(0,stolenrot.y,0);
};
// uncomment the swap method to enable hot-reloading for this script
// update the method body to copy state from the old instance
// Stealyrot.prototype.swap = function(old) { };
// learn more about scripting here:
// https://developer.playcanvas.com/user-manual/scripting/
Thanks for any help you can give!