[SOLVED] How to use pc.math.lerpAngle?

Hi, I’m trying to use pc.math.lerpAngle, but I’m unsure on how to use this.
I have tried using it this way:

var a = 0;
var b = 22.5;
var r = 0.11;

var zrot = pc.math.clamp(this.velocity, -2, -0.75);
zrot += 1;

this.entity.setLocalEulerAngles(0, 0, zrot * 90);
pc.math.lerpAngle(a, b, r);

i get the error this.entity.lerpAngle is not a function
but this didn’t work? any help is very appreciated! :slightly_smiling_face:

Don’t really know how to use lerpAngle myself, but have you tried doing this

pc.math.lerpAngle = new pc.Vec3(a, b ,r);

or

var Value = new pc.Vec3(a, b, r);

pc.math.lerpAngle(Value);

If this doesn’t work try reaching out to @will or @yaustar.

Sorry, this didn’t work, but thanks! you fixed my errors

Nice!

01101000 01100001 01110000 01110000 01111001 01111001 01101111 01110101 01100110 01101111 01110101 01101110 01100100 01110100 01101000 01100101 01100001 01101110 01110011 01110111 01100101 01110010

happyyoufoundtheanswer
thanks lol

1 Like

Ah, you found it out. Added it in just for fun really lol.