13 years ago

Artificial Intelligence JavaScript Unity 3D


Advanced artificial intelligence in javaScript

#pragma strict

var alvo : GameObject;

var pos : Vector3;

var dist : float;

function Start () {

alvo = GameObject.Find (โ€œPlayerโ€);

dist = 6;

}

function Update () {

pos = alvo.transform.position;

if(alvo && Distancia ()){

var alvoRotacao = Quaternion.LookRotation (pos - transform.position , Vector3.up);

transform.rotation = Quaternion.Slerp (transform.rotation , alvoRotacao , Time.deltaTime * 3);

}

}

function Distancia (){

if(Vector3.Distance (transform.position , pos) > dist){

return false;

}

else{

return true;

}

}



0 comments

Loading...

Next up

Smile! Here, take some happy pills! โœจ๐Ÿ’Š #Blender #3DModelling #3DArt Buy me a Ko-fi: https://ko-fi.com/barbarafb_

Enemies can also suddenly spawn through Realm Rifts. These Rift Spawns are going to be stronger than the ones wandering around. TBD on the enemies... #screenshotsaturday #godstear #madewithunity

Family band complete!

Showing off player 2 ๐Ÿ˜Ž

What do you think?

brung back my old oc plus a new one

...they don`t have names yet tho

Levels' maps.

Made my first ever animation.

Some Shadow boss fight gameplay ๐Ÿ‘พ

A few screenshots of the places you'll cross in the Demo of Blu. You can play it today on #gamejolt !

Animation test. Not an actaul conclusion to who wins sonic vs Mario. Just a test animation combo.