Comments

Log in with itch.io to leave a comment.

Out of curiosity how did you get the missile to follow the tank?

It wasn't actually too much code. I was able piece it together from examples online.  It probably going to be ugly but I pasted it below.  The first line move the missile towards the player, the rest rotate the missile to point at the player.

transform.position = Vector3.MoveTowards(transform.position, player.transform.position, 2.8f * Time.deltaTime);


Vector2 movementDirection = player.transform.position - transform.position;

movementDirection.Normalize();

if (movementDirection != Vector2.zero)

{

                Quaternion toRotation = Quaternion.LookRotation(Vector3.forward, movementDirection);

                transform.rotation = Quaternion.RotateTowards(transform.rotation, toRotation, 720 * Time.deltaTime);

}

(+1)

It's a serious challenge! That or I'm an awful driver. hehe Great game!

(+1)

Thanks, I wanted to add so much more, including a way for the tank to fight back but time ran out on me.

(1 edit)

I'm also considering slowing down the missile speed.  The original idea was to have the missile speed up the longer you stay alive.