Method GetAssistedVelocity
GetAssistedVelocity(in Vector3, in Vector3, float)
Takes a projectile's velocity and adjusts it to more closely hit a given target.
Declaration
public Vector3 GetAssistedVelocity(in Vector3 source, in Vector3 velocity, float gravity)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | source | The starting position of the projectile. |
| Vector3 | velocity | The starting velocity of the projectile. |
| float | gravity | How much gravity the projectile is experiencing. |
Returns
| Type | Description |
|---|---|
| Vector3 | Returns a velocity based on the source, but adjusted to hit a given target. |
Implements
GetAssistedVelocity(in Vector3, in Vector3, float, float)
Takes a projectile's velocity and adjusts it to more closely hit a given target.
Declaration
public Vector3 GetAssistedVelocity(in Vector3 source, in Vector3 velocity, float gravity, float maxAngle)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | source | The starting position of the projectile. |
| Vector3 | velocity | The starting velocity of the projectile. |
| float | gravity | How much gravity the projectile is experiencing. |
| float | maxAngle | If the angle between the initial velocity and adjusted velocity is greater than this value, no adjustment will occur. |
Returns
| Type | Description |
|---|---|
| Vector3 | Returns a velocity based on the source, but adjusted to hit a given target. |