Advertisement

Unity Rigidbody movement jitter

Started by September 09, 2018 06:05 PM
11 comments, last by ptietz 6 years, 2 months ago
3 hours ago, ptietz said:

What I call "space" here is separated into different "sectors", ...

What you are trying here won't work in Unity.

Unity has only one world space and as such what you are doing with "sectors" is this:

UnitySpace.jpg.91dea1e28fccdf521991fffabbfc619d.jpg

Basically you where just stretching the world space.

 

Resetting the world to (0,0,0) as mentioned by JoeJ is known as origin rebasing and is the common way of fixing this problem. Strangely Unity has no way to do this build in, so you have to do it manually.

There is a code provided by the Unity community: http://wiki.unity3d.com/index.php/Floating_Origin but as most of the code provided on this wiki you will have to manually update it.

So, I implemented the approach, test-wise (thx so much for the Link @Scouting Ninja!), which was fairly easy because of my existing architecture. Here's what I got:

  • The jitter has disappeared! - Or so at least for everything around the player (or current main camera).
  • There's a visible stutter in the frame the re-positioning occurs.
    I will try to optimize that if I can. (Any input on that?)
  • Supposedly, I might have to say good bye to the idea of a fully physics-based simulation,
    which is, luckily, not a game-breaker.
    I guess, I'll have to implement a separate, non-physics-based, behavior for NPC game world objects that are out of players' sight (or the re-positioning threshold, for that matter). And then a script to switch between them, of course.

Thank you all, guys, for your help!

This topic is closed to new replies.

Advertisement