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

Shadow The Hedgehog X pixel art

So here's the first of the zodiac signs i will make for the next weeks.

We're glad to announce that Baby Dino Adventures 🦖 is now available in Early Access here on GameJolt! Link: https://gamejolt.com/games/babydinoadventures/508121 Walk, run, and jump as a baby t-rex in this cute platformer Free demo available #IndieGame | #GameDev | #PixelArt

"Day to Day" (also check spud out here he's a great guy and writer: https://soundcloud.com/spudward)

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.

Szayel Aporro Granz - Bleach

I did this on my 3DS ^^ #Kirby

Some Shadow boss fight gameplay 👾

A few screenshots of the places you'll cross in the Demo of Blu. You can play it today on #gamejolt !

We're knee deep in multiple large features and "game feel". Quick peek behind the scenes in this weeks Dev Blog: https://bit.ly/2QmmaQM