A
A
Alexander2020-12-30 22:04:51
Game development
Alexander, 2020-12-30 22:04:51

Where is the mistake in changing the angle of departure of shells?

I have a turret that spins with:

cannon.rotation = Quaternion.Slerp(cannon.rotation,
            Quaternion.LookRotation(target.transform.position - cannon.position),
            rotationSpeed * Time.deltaTime); // Update метод


And there is a spawn point (an empty object), which is the child of the gun. I set the movement of the projectile with:
rocketRB.AddForce(0, 0, -4000 * Time.deltaTime); // Update метод

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dollar, 2020-12-31
@AlexandrG44

And where did you get the idea that the acceleration depends on the position of the turret?
After all , AddForce adds accelerations in world coordinates , regardless of the rotation of the parent objects. This is the mistake.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question