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_

Shoobies leave a sticky trail of mucus in their wake, which can impede movement for any creature that steps in it.

Fan art for Foolish I'm feeling kinda better so I drew this

Showing off player 2 ๐Ÿ˜Ž

What do you think?

Alone Together....

it happens

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

Coming Soon...

blender animation experimentation, getting the hang of things fast. arms, rig, & gun models by me ofc

ooh yes..