Simple Solution?
Big but possibly etremely simple c# question: I have these two scripts, PlayerOrbits, which controls the entire movement of the player, and Trajectory, which is supposed to show an exact prediction of where the player will go when you unpause the game. Currently, I have these two working on from what I can tell to be the same physics. Thing is, the two are ever so slightly different and it causes cool prediction stuff to get drastically far away from the intended route. Any ideas on why this might be happening?
2 Replies
Oh yeah, and the video shows what I mean. The first couple frames of the video show the predicted movement and then it shows how they end up deviating slightly and crashing
your sim runs 20x more steps than real physics
so i would probably do time.fixeddeltatime
(float deltaTime = Time.deltaTime)
and another you got force scaling
so a quick lil thing instead of simulatedVel += acceleration;
try doing simulatedVel = new Vector2(simulatedVel.x + forceX, simulatedVel.y + forceY);