Visualizing a Trajectory

OK smarter Unreal Developers than me…

I have the same problem. The dots that need to get connected are the gravity force I think. I am just typing in values in the gravity variable to experiment. In my game, gravity and achieving orbit WORKS! I can get my trajectory line close with this formula:

X = StartX + Velocity.X * Time
Y = StartY + Velocity.Y * Time
Z = StartZ + Velocity.Z * Time + (Gravity * (Time^2))/2

But I am manually typing in my gravity force.

It should be just math, and therefore exact if we can get the correct arrangement of values.

Here is what I have:

  • Gravity only between Pawn and Sphere in space (simplified gravity).
  • No dampening which. To confirm, I display velocity, which is constant without input.
  • Overlapping a radius around sphere subjects the pawn to its constant gravity using a Radial Force Component.
  • Radial Force has a force of negative 75 Million (that’s what it takes!)

Gravity works with this setup. I can indeed achieve orbit, but I cannot get the trajectory line calculation to be precise.

To get the trajectory points, I ForEach through a 20 Item Array of time variables which goes into Time in the equation. Maybe this introduces issues as well?

Entire BP is here: