Raised This Month: $ Target: $400
 0% 

Solved How do you make one entity rotate at a certain speed toward another?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
LiZou Mapper
Member
Join Date: Oct 2018
Location: The Red City !
Old 10-13-2022 , 19:40   How do you make one entity rotate at a certain speed toward another?
Reply With Quote #1

Hello !
This is method how I use to make the NPC rotate towards the enemy, but it's boring and bad.

PHP Code:
pev(entpev_originvOrigin)
pev(victimpev_originvVicOrigin)

xs_vec_sub(vVicOriginvOriginvVector)

// Convert vector to angles.
vector_to_angle(vVectorvAngles)

vAngles[0] = 0.0
vAngles
[2] = 0.0
    
pev
(entpev_anglesvAngles
I tried to make this entity rotate but at a certain speed towards some entity like NPCs in Half-Life.It rotates from the near direction of the enemy, for example, if the enemy is on the right side of an entity, the entity will rotate towards the right direction.

Thanks in advance
__________________

-------------
My Maps !
Zombie Escape Mod !
-------------


Last edited by LiZou Mapper; 10-14-2022 at 10:56. Reason: Solved!
LiZou Mapper is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:33.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode