11 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

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

We made a lot of improvements on the Freezing Plains visual. Things like pine trees, tiny bushes, some rocks, and others game props!

#IndieGame | #IndieDev | #GameDev | #PixelArt | #WaifuQuest | #WifeQuest | #screenshotsaturday

Double Rainbow!!!

The Authority decided to investigate the Basement and leads to recovering classified documents Fun fact: The building has 928 doors and not 1000 doors. #horror

Daldos Gameplay

Aston Martin Vantage 2019

Day 4, Achieved

#AstonMartin #FastChallenge #speedmodeling

I remade my main character, what do you think? :)

NEW AWP DESIGN !

(sound ON 🔊) We changed the tree harvesting selection sounds. Again.

Should we stop already? Let us know!

Find out more about the game on Steam:

http://bit.ly/AtS_New_Sounds_GJ

Snacktime