Guys, help. How can i get it? I need to use it in this function:
Code:public Vector3 GetPredictedShootVector(ITrackedObject target) { IVelocityProvider componentByInterface = target.GetGameObject().GetComponentByInterface<IVelocityProvider>(); if (componentByInterface == null || componentByInterface.Equals(null)) { return (base.transform.position - target.GetCachedPosition()).normalized; } Vector3 velocity = componentByInterface.GetVelocity(); Vector3 cachedPosition = target.GetCachedPosition(); float attackPower = this.AttackPower * Time.deltaTime; Debug.DrawLine(cachedPosition + (velocity * attackPower), (cachedPosition + (velocity * attackPower)) + Vector3.up, Color.cyan, 2f); Vector3 vector3 = (cachedPosition + (velocity * attackPower)) - base.transform.position; return vector3.normalized; }
Getting ITrackedObject target?
Discussion in 'Hurtworld Development' started by DJDiamonD, Mar 15, 2016.