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

Successful landing

#screenshotsaturday

Path of Kami: The Evolution of the Lore

What do you think guys in my robot?Just a beginner in 3d modeling..

My instagram https://www.instagram.com/rojhonbb/

Horror WIP A track that will be featured in a future horror game soundtrack! Stay tuned!

Likes appreciated ✌️

#gamedev #composer #horrorgame #indiegame #IndieGameDev #soundtrack

Very ambitious construction going on in Planet Zoo on Plays today. We're tryin'. LIVE: www.twitch.tv/dreamhackplays

Szayel Aporro Granz - Bleach

Animation test. Not an actaul conclusion to who wins sonic vs Mario. Just a test animation combo.

Double Rainbow!!!

Distrust - HUMERUS (with dirty shade) Papyrus isn`t small. It's possible that I didn't draw him well, but he crouched down and bent towards us. I'm still bad at moments like this

What Are You Doing In My Swamp!?

Now spruce forest monsters can vomit forest shields, but Brutal Castle will not stop!

#gamedev #pixelart #indie