My case is:
We are developing a kart racing game, and the players are fighting with each other and trying to reach the finish line.
The thing is, I am confused over how to implement following logic:
The player has missile and grenade as weapons.
I can do missile lock, then the missile follows the enemy and hits the enemy with it. (Vector3.MoveTowards()).
But how would I do grenades?
Suppose both enemies and players are moving forward on the Z axis:
Case 1:
Player throws grenade at enemy.
It goes and hits enemy.
**I can do this the same way as missile logic.
Case 2:
Player throws grenade at enemy.
Enemy changes position on the X axis (right, left).
Grenade should not follow player to the next position.
**I am confused about this case: how to let grenade not change its position and get the blast on surface??