Thursday 23 October 2014

Moments of frustration! What the hell am I supposed to do?!

Oh dear...

Just started to continue my racing game project. Finally I found some great setups for wheel colliders. Even without coding, it worked pretty well, but using some codes to dynamically edit the friction values of the wheel colliders could do some wonderful things. BUT!

Everything went way too nicely. Dark clouds gathered over my head... It was the calm before storm... After happily playing with the car and break some record lap times I decided to use the fake anti-aliasing script. It doesn't work in the editor for some reason. I mean the reason is that v-sync doesn't work, so it can't run with fixed 60 FPS. So I decided to build a webplayer version. It has been started. The great work. My creature... my child... my new experiment... I was so excited!

After some long second... it was born! I had to check it out. I started to run the webplayer build locally and... something went wrong! What happened to it?! Why did that happened?! WHY?!

It was horrible. A horrible, distorted creature. Two wheels were missing. No, not just that. Even its chassis wasn't there. How could it happen? Calm down... calm down... I told myself.

Let's go back to Unity editor. Nothing can be wrong, right? It must be a problem with the web player build. I was sure about it. I had similar problem back then, when in the editor, everything was perfect, but in the WebPlayer build something was wrong. Something was wrong... something was wrong! Even in the editor! I... I was confused... I am confused! It was working perfectly before!

I saw errors. Failures. I don't know why? What happened, what changed. I tried different things to fix it, but I don't really know, what's the problem?

!CompareApproximately (SqrMagnitude (q), 1.0F)
UnityEngine.Quaternion:Euler(Single, Single, Single)


transform.rotation assign attempt for 'WheelFR' is not valid. Input rotation is { NaN, NaN, NaN, NaN }.
UnityEngine.Transform:set_rotation(Quaternion)


What? Why?! It's at the two wheels. But I didn't change a thing at the coding part and they use the same code. So what's the difference? What don't they work as the other wheels? Oh, anyway, all the wheels and the chassis are at place. So it's different than the webplayer build. But the result is still the same.

Other error, when WheelColliders reach the road.

transform.position assign attempt for 'GenericCar' is not valid. Input position is { NaN, NaN, NaN }.

Not A Number... REALLY?! WHY! I read about that division by 0 can cause this, but I don't do that. As far as I know. Where the errors point, there is no division. Can it be because of a glitch in Unity 4.6 beta? I updated to the latest beta and it still doesn't work... *sigh*

I am confused. The creature I created is a failure. It's not complete. It's abnormal. It's an anomaly... What am I supposed to do?!

Wednesday 15 October 2014

Cheapest anti-aliasing ever!

Did you play Gran Turismo on PSP? If yes, you may know, that games uses a very simple, efficient, and acceptable quality anti-aliasing method. What does it do exactly? It moves the camera in every second frame one pixel right and up. That's it!