4 registered members (ozgur, Ayumi, VHX, monarch),
1,161
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: How i can make to a entity turn to face player
[Re: LWD]
#105484
01/05/07 17:50
01/05/07 17:50
|
Joined: Nov 2006
Posts: 169 Sachsen-Anhalt, Germany
JackTheRipper
Member
|
Member
Joined: Nov 2006
Posts: 169
Sachsen-Anhalt, Germany
|
Hi! You can put : Code:
vec_set(temp, player.x); vec_sub(temp, my.x); vec_to_angle(my.pan, temp);
into your action! but make sure your player is the player entity! if the player isent the player put : Code:
entity* player;
action ... { ... player = me; ... } into the player action! ok... hope this helps! -jack
Last edited by JackTheRipper; 01/05/07 17:52.
Cheers Jack Out!
Bandiera rossa la trionferą Evviva il socialismo e la libertą.
|
|
|
Re: How i can make to a entity turn to face player
[Re: aztec]
#105487
01/05/07 18:45
01/05/07 18:45
|
Joined: Nov 2006
Posts: 169 Sachsen-Anhalt, Germany
JackTheRipper
Member
|
Member
Joined: Nov 2006
Posts: 169
Sachsen-Anhalt, Germany
|
yeah i forgot it in a while-loop! while(1) { vec_set(temp, player.x); vec_sub(temp, my.x); vec_to_angle(my.pan, temp); wait(1); } thx aztec! -jack
Cheers Jack Out!
Bandiera rossa la trionferą Evviva il socialismo e la libertą.
|
|
|
Re: How i can make to a entity turn to face player
[Re: aztec]
#105491
01/05/07 19:14
01/05/07 19:14
|
Joined: Jan 2006
Posts: 53
LWD
OP
Junior Member
|
OP
Junior Member
Joined: Jan 2006
Posts: 53
|
Thanks! But this code dont work :/, but if i remove the line if (key_e == on)the code works, but the entity turns without i press any key... Thanks!
Last edited by LWD; 01/05/07 19:15.
|
|
|
Re: How i can make to a entity turn to face player
[Re: LWD]
#105492
01/05/07 19:20
01/05/07 19:20
|
Joined: Nov 2006
Posts: 169 Sachsen-Anhalt, Germany
JackTheRipper
Member
|
Member
Joined: Nov 2006
Posts: 169
Sachsen-Anhalt, Germany
|
you must set all in a while-loop and it should work fine! hope this helps!
-jack
Cheers Jack Out!
Bandiera rossa la trionferą Evviva il socialismo e la libertą.
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|