edited March 2014 in ORK Support
Good evening

In real-time battle , lock on the nearest enemy , I'm trying to move around the enemy .
As player of the video just below .

I want to continue the direction towards the opponent slowly than Lookat(), you want to use the quaternion.
(LookAt() is to face the direction of the enemy, but because it is a moment, rotation is too fast)

I would like to have a variable of lock-on script of my closest enemy , but I can get GameObject enemy and how the nearest (Transform)?
http://api.orkframework.com/class_o_r_k_framework_1_1_events_1_1_steps_1_1_check_distance_step.html
Use this class ?

http://orkframework.com/howto/2014/02/16/scripting-where-is-what/
I'm doing as you read this tutorial , Is there an easy way ?

Of ORK menu -> Combatants - AI Settings - Target Selection Settings - 「Nearest Target」
I want to get this from My Script.
How can a simple if there is a Class that can get this .

I put the script of remodeling during my.
----------------------------


#pragma strict
import ORKFramework;
import ORKFramework.Behaviours;

var turnspeed : float ; // change it whenever you need to turn

function Start () {

}

function Update () {

var Enemys = GameObject.FindGameObjectsWithTag("Enemy");
//Enemy = ORKFramework.Events.Steps.CheckDistanceStep // <<<---- ?????

// LookAt Enemys
for (var Enemy : GameObject in Enemys)
{
if (Enemy != null )
{
var rotation = Quaternion.LookRotation(Enemy.transform.position - transform.position);
transform.rotation = Quaternion.Slerp(transform.rotation, rotation, Time.deltaTime * turnspeed);

}
}
}
Post edited by joeee19 on
Sign In or Register to comment.