What happens when you go TOO FAR? (Floating Point Error)

Channel:
Subscribers:
566,000
Published on ● Video Link: https://www.youtube.com/watch?v=TZSWCVzHlxY



Duration: 0:00
10,779 views
770


✅ Watch my FREE C# Course!    • Learn C# FREE Tutorial Course Beginne...  
🌍 FREE Game Dev Report Newsletterhttps://cmonkey.co/gamedevreportnewsletter.
🎮 Play my Steam game!https://cmonkey.co/dinkyguardianss
❤ ️ Watch my FREE Complete Courses    • Learn to make Games with Unity (FREE ...  
🌍 Get my Complete Courses!https://unitycodemonkey.com/coursesrses
👍 Learn to make awesome games step-by-step from start to finish.
🎮 Get my Steam Gahttps://unitycodemonkey.com/gamebundlendle

🔴 RELATED VIDEOS 🔴
Learn C# FREE Tutorial Course Beginner to Advanced! [12 HOURS]    • Learn C# FREE Tutorial Course Beginne...  
Can I make an OPEN WORLD Game in ONE WEEK?    • Can I make an OPEN WORLD Game in ONE ...  
Can I add MULTIPLAYER to my Open World Game in 4 HOURS?    • Can I add MULTIPLAYER to my Open Worl...  
I also make MISTAKES!    • I also make MISTAKES!  

💬 Do you know what is going on in this video? Such a strange bug where a normal looking Sphere suddenly becomes all jittery and messed up.
The answer: Floating point precision.
Floats have a limited number of digits, so if you position an object in a huge position, it won't have enough space for many digits after the decimal point, they will be forced to round up or down. Meaning all the vertices on the sphere won't be able to go to their exact position, so they start jumping up and down as the value is being rounded.
One fix to this problem is a Floating Origin Point. This is where you can keep track of the player position, and if the player is too far from the origin you teleport them and the entire world back near the origin. As long as the relative offsets remain the same it won't have a visual difference but will help solve this issue.

📝 Some Links are Affiliate links which means it costs the same to you and I get a nice commission.
🌍 Get Code Monkey on Steam!
👍 Interactive Tutorials, Complete Games and Morehttps://store.steampowered.com/app/1294220/12...

If you have any questions post them in the comments and I'll do my best to answer them.

🔔 Subscribe for more Unity Tutorials    / @codemonkeyunity  

See you next time!

📍 Support on Pathttps://www.patreon.com/unitycodemonkeykey  
🎮 Grab the Game Bundlhttps://unitycodemonkey.com/gameBundle.phpdl...
📝 Get the Code Monkey Utilitiehttps://unitycodemonkey.com/utils.phps.php

#gamedev

--------------------------------------------------------------------
Hello and Welcome!
I'm your Code Monkey and here you will learn everything about Game Development in Unity using C#.

I've been developing games for several years with 8 published games on Steam and now I'm sharing my knowledge to help you on your own game development journey.

I do Unity Tutorials on just about every topic, Unity Tutorials for Beginners and Unity Tutorials for Advanced users.
--------------------------------------------------------------------
Webshttps://unitycodemonkey.com/.com/
Twithttps://twitter.com/UnityCodeMonkeykey  
Sthttps://store.steampowered.com/developer/EndlessLoopStudioslo...