Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (TipmyPip, AndrewAMD, NewbieZorro), 16,655 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Make an entity always look at another entity. #289690
09/14/09 21:32
09/14/09 21:32
Joined: Jan 2005
Posts: 267
the Netherlands
Paulo Offline OP
Member
Paulo  Offline OP
Member

Joined: Jan 2005
Posts: 267
the Netherlands
Hi,

I forgot how i can make an entity always look at another entity.
I cant seem to get it to work in lite-c.

Maybe someone can help my on my way?

Thanks,

Last edited by Paulo; 09/14/09 21:32.

The more you have.. the more you can lose...
Dont tell em all you know.....
Re: Make an entity always look at another entity. [Re: Paulo] #289694
09/14/09 22:06
09/14/09 22:06
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
Code:
VECTOR temp;
while(1)
{
vec_set(temp,entity2.x); 
vec_sub(temp,entity1.x);
vec_to_angle(entity1.pan,temp); // now entity1 looks at the entity2
wait(1);
}



Re: Make an entity always look at another entity. [Re: Paulo] #289696
09/14/09 22:08
09/14/09 22:08
Joined: Sep 2008
Posts: 68
T
Tai Offline
Junior Member
Tai  Offline
Junior Member
T

Joined: Sep 2008
Posts: 68
VECTOR temp;
vec_set(your.x,temp);
vec_sub(temp,my.x);
vec_to_angle(temp,my.pan);

Put that in a while loop in the entities action (your.x being the entity of course)

EDIT: Beat me to it grin

Last edited by Tai; 09/14/09 22:09.
Re: Make an entity always look at another entity. [Re: Tai] #289699
09/14/09 22:50
09/14/09 22:50
Joined: Jan 2005
Posts: 267
the Netherlands
Paulo Offline OP
Member
Paulo  Offline OP
Member

Joined: Jan 2005
Posts: 267
the Netherlands
Thanks guys !


The more you have.. the more you can lose...
Dont tell em all you know.....

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1