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

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

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

Family band complete!

Microsoft Windows XP Unprofessional (windows logo prototype)

Update 2.627

New challenges & new effects!

Today I tackled drawing different variations of facial expressions for one of the main characters in Eden. What do you think of it? :) Eden: https://gamejolt.com/games/Eden/592698

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

brung back my old oc plus a new one

...they don`t have names yet tho

Let me introduce you to the new Mech line: Gendai Spec. Those are Mech that specializes in surprise attacks, covered operations, and stealth. They are equipped with melee weapons but one of Gendai's frames supports sniper rifles.