Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (Akow), 1,403 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 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 | chip programmers | 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