Skip to content

LookWhereYouAreGoingBehavior

Oğuz Eroğlu edited this page Aug 19, 2020 · 3 revisions

Demo

This demo uses LookWhereYouAreGoingBehavior to align the gun position as the bots are randomly moving through the map.

Definition

Unlike other behaviors, LookWhereYouAreGoingBehavior behavior does not make a steerable move, but makes it face the direction it's moving.

Usage

// create a steerable
var steerable = new Kompute.Steerable("steerable1", new Kompute.Vector3D(700, 800, 900), new Kompute.Vector3D(10, 10, 10));

// create an instance of LookWhereYouAreGoingBehavior
var lookWhereYouAreGoingBehavior = new Kompute.LookWhereYouAreGoingBehavior();

// set the lookSpeed of the steerable.
// this is optional. default lookSpeed is 0.1
steerable.lookSpeed = 0.05;

// set the behavior
steerable.setBehavior(lookWhereYouAreGoingBehavior);

Clone this wiki locally