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

Did you know that today is #InternationalJazzDay? ๐ŸŽท๐Ÿ˜Ž

No? ๐Ÿ˜ฏ Well, we couldn't pass up this date!

And what better to celebrate this day than #Pecaminosa #OST? ๐ŸŽท

Let us know what you think about it and have a great weekend!

So

i may or may not make an full art of some person or i may just leave this like that-

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

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

"Thanks guys for endless hours of fun." ๐Ÿ‘

(My first fan art. Read the article, please.)

#sonic #mario #photoshop

๐Ÿ’Did you like the game? A demo is available for free on Steam.

โœŒ๏ธ Thanks for playing IndieGameiacs!

โš™๏ธ Free Demo: http://bit.ly/UniDuni

๐Ÿ“บ Full Video: https://youtu.be/5qEbVXg7GaQ

#steam #uniduni #clops #screenshotsaturday

One of the most critical update for Sunblaze demo. Now you are able to pet a cat! Finally!

Why walk when you can jump?

I worked so hard to get all four of them to the end safely, but then...

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