Merge pull request #1585 from MoritzBrueckner/navmesh

Expose NavAgent turn speed to the UI
This commit is contained in:
Lubos Lenco 2020-02-23 11:00:08 +01:00 committed by GitHub
commit b3491dd462
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,6 +9,8 @@ class NavAgent extends Trait {
@prop
var speed: Float = 5;
@prop
var turnDuration: Float = 0.4;
var path: Array<Vec4> = null;
var index = 0;
@ -64,7 +66,7 @@ class NavAgent extends Trait {
}});
var q = new Quat();
rotAnim = Tween.to({ target: object.transform, props: { rot: q.fromEuler(0, 0, targetAngle) }, duration: 0.4});
rotAnim = Tween.to({ target: object.transform, props: { rot: q.fromEuler(0, 0, targetAngle) }, duration: turnDuration});
}
function update() {