Hello friends,
This is my first time asking a question, I hope I can find the answer. Sorry for my bad english in advance.
I’m trying to make an Oblique Projectile Motion for a tower defense game. I actually did the physics part. It works as I want in the start method but I need to put it in the update method. Because my targets are moving objects.
private void FixedUpdate()
{
if (gameObject.CompareTag("TowerCatapult"))
{
if (!oneTime)
{
rb.velocity = VelocityCalc(target.position, transform.position, 1f);
oneTime = true;
}
}
}
Vector3 VelocityCalc(Vector3 target, Vector3 start, float time)
{
// physics code
}
Maybe it’s too easy but I don’t understand. Do you have an idea not to miss the target?
alarmedwelcomeapatosaur