Raised This Month: $ Target: $400
 0% 

Using velocity_by_aim() to Get Other Directions


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 08-06-2010 , 13:18   Re: Using velocity_by_aim() to Get Other Directions
Reply With Quote #4

Quote:
Originally Posted by hleV View Post
Didn't help.
Or I may need an example to fit it into my code.
Code:
new Float:fAngles[3]
new Float:fVelocity[3]

entity_get_vector(id, EV_VEC_angles, fAngles)

angle_vector(fAngles, ANGLEVECTOR_RIGHT, fVelocity)

// fVelocity now points RIGHT

fVelocity[0] *= -1.0
fVelocity[1] *= -1.0
fVelocity[2] *= -1.0

// fVelocity now points LEFT
not tested.

If it's up and down of player you don't need to calculate these... you only need to set fVelocity[2] to a negative or positive value.
Unless you want to be up/down of player's VIEW, then you need to supply EV_VEC_v_angle
__________________

Last edited by Hunter-Digital; 08-06-2010 at 13:24.
Hunter-Digital is offline
 



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 00:18.


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