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

Short intro of us ๐Ÿ’•โœŒ๏ธ

We're an eletro duo based in Seoul ๐Ÿ‡ฐ๐Ÿ‡ท Heavily influenced by the 90s.

Our new album #Xennials is all about the nostalgia of that era ๐Ÿ’ฝ CD listenin ๐Ÿ“Ÿ beeper beepin ๐Ÿ’พ floppy disks floppin days ๐Ÿ˜Ž

Stream now! ๐ŸŽง

https://open.spotify.com/album/3YwWhnHWVy5cA8XOpbaGRA?si=8E9awqUโ€ฆ

Been working lately on lots of 'behind-the-scenes' boring stuff that no one really cares about, so hereโ€™s a guy playing the sax for some reason.

#screenshotsaturday

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

Heya there! I really wanted to show you all a little gameplay preview of the first boss fight i'm currently working on i hope you like it ^^

Path of Kami: The Evolution of the Lore

Microsoft Windows XP Unprofessional (windows logo prototype)

My D&D art for my family so far (WIP if you couldn't tell)

Path of Kami, running around the shrine area

Out of boredom and curiosity, I coded Sailor Jupiter's Argentine Backbreaker.

Double Rainbow!!!