Raised This Month: $ Target: $400
 0% 

Solved Get direction player is moving relative to other player


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 03-02-2021 , 08:03   Re: Get direction player is moving relative to other player
Reply With Quote #4

Quote:
Originally Posted by Effeff View Post
I am guessing what I forgot to do is use NormalizeVector somewhere?
Yeah you should normalize both vectors. Dot product takes vector magnitudes into account but you're not interested in that, hence why we want unit vectors. Also you don't need the AddVectors and MakeVectorFromPoints part - attackerVel and attackerVelVec are equivalent vectors in your case. Also as you seem to have some trouble wrapping your head arounds vectors in space, read up on free and bound vectors; I think that may help you a bit. Here we are always working with free vectors - the initial point of all vectors is the world origin (0, 0, 0), so all vectors with the same direction and magnitude are equivalent.
While you may be thinking of velocity as this:

In actuality it's just this:
__________________

Last edited by klippy; 03-02-2021 at 08:13.
klippy 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 17:38.


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