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…

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

"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

I have added rewards for quests so that villagers can give you something in return for your hard work helping them. πŸ₯³

I want to know - what's your favourite quest reward?

Just a Pico sprite

Heya! I wanted to show some gameplay progress i made so far. I hope you like it ^^

Strange Umbrella

Showing off player 2 😎

What do you think?

a drawing I did because I was boredπŸ˜ͺ. But I love how it turned out.😊