The title says it all really. Here is the piece of code.
if (collision.gameObject.tag == "Asteroid")
{
rigidbody.AddRelativeForce(horSpeedX + collision.gameObject.tag.Asteroid.horSpeedX * Time.deltaTime,horSpeedY + collision.gameObject.tag.Asteroid.horSpeedY * Time.deltaTime, 0);
}
What I am trying to do with this is have an object inherit the colliding objects speed (which is collision.gameobject.tag.Asteroid).
Thanks in advance
If you have javascript that is calles Asteroid.js or a C# class Asteroid you can do what I wrote in the answer.
– StephanK