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

Just as Pecaminosa's musicians #improvise this rendition of #LittleSunflower 🌻, so do we improvise with this post you're reading. 😂

What's coming out of your own improvs? 🤔

#Pecaminosa | #IndieDev | #OST | #Jazz

Demonstration of the spells and their effects :)!

Our menu, gathered a huge feedback and positive comments among foreign audience, what you say? Game Steam: https://store.steampowered.com/app/1543090/LiBER/

Colorful Fox

Happy Late Easter!

It's now possible to destroy some of the obstacles and gain access to new locations or create shortcuts. #gamedev #indiegame #rpg

I thought I would do a quick show and tell, with a 2 min video of the start of the game and some of the game elements, after many many months it is really starting to come together, time to start networking https://gamejolt.com/games/Dungeon_fable/490669

I hate that stupid cupcake.

(New FNAF Friday show this week) (was sick for the last few days, sorry)

I spent two days choosing a candidate for the scenario and finally I found <3 Hope you like it!! >.<

One for all, and all for one! 🙌