K
K
korner-brazers2016-12-13 16:17:37
Unity
korner-brazers, 2016-12-13 16:17:37

How to launch a rocket in a spiral and with a course deviation?

Friends, I'm trying to create a rocket launch that would fly a little in a spiral, for example, as in GTA 4-5, + to this, something would deviate a little from the course.
How to do something to deviate from the course found an example:

timeout+= Time.deltaTime;
if(timeout>2f)
{
    scatter = Random.Range(-Scatter,Scatter);
     timeout = 0;
}
transform.Translate(Vector3.forward * Time.deltaTime*Speed);
transform.RotateAround(transform.position, transform.TransformDirection(Vector3.right), scatter*Time.deltaTime);
transform.RotateAround(transform.position, transform.TransformDirection(Vector3.up), scatter*Time.deltaTime);

But it’s not like I can’t make it fly in a spiral a little, I just tried to rotate it to the right and down, but nothing good happened))

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GreatRash, 2016-12-13
@korner-brazers

answers.unity3d.com/questions/37025/possible-to-ad...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question