calculating different velocities from an origin
I'm wondering if it would be possible to calculate an "knockback" velocity from an certain origin. like ex: if you are behind the origin you will fly backwards and if ur infront of the origin you will fly forwards. If this alredy exists on the forum then im sorry for my bad searching but i didnt rly know what search words to use
|
Re: calculating different velocities from an origin
U need kind of a force field ? Right ?
|
Re: calculating different velocities from an origin
Quote:
|
Re: calculating different velocities from an origin
You just need to find the vector from the origin (explosion) to the player and use that direction as the direction of the player's velocity (you would need to scale the magnitude appropriately).
|
Re: calculating different velocities from an origin
Quote:
|
Re: calculating different velocities from an origin
Lets give you an idea:
Code:
For more info you can read this tutorial coz that is how i learned this vector stuff. https://forums.alliedmods.net/showthread.php?t=91474 |
Re: calculating different velocities from an origin
Quote:
|
Re: calculating different velocities from an origin
Quote:
|
Re: calculating different velocities from an origin
Quote:
|
Re: calculating different velocities from an origin
Quote:
|
| All times are GMT -4. The time now is 00:49. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.