- Home /

# Predicting trajectory using Equations of Motion considering drag & Magnus effect

Hi everyone,

**Problem:**

Applying velocity to a gameobject such that it hits a target point, considering the objects drag and applied force via magnus effect.

I can currently perfectly predict where the ball is due to go in time, based on a set velocity, rotation speed, drag and resulting magnus effect. This requires calculating the changes in ball speed for drag and applied force from the magnus effect each frame.

I have a function which will return the magnus force to be applied this frame based on the balls speed and rotational speed.

I currently have two methods to set the ball velocity, of which neither consider object drag, nor my applied magnus force, so are not quite accurate with no magnus effect and entirely wrong with magnus effect: Thread 1 and Thread 2.

**Question:**

How do I calculate the velocity such that it accounts for the objects drag and also the cumulative displacement of the magnus effect over time?

The ball is moved with the calculated velocity with an AddForce Forcemode.Impulse function. The magnus effect is applied per frame with AddForce Forcemode.Force.

### Your answer

### Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.