Laggy and more laggy rendering!

Hi.
What is wrong with this engine…I put a mouse look on my camera and when I look around I always get a stupid frame smoothing, the rendering/ looking is never crisp, its always behind my mouse movement, resulting in an unplayable game!
It works just fine in other game engines/ games. .but never in unity, not even in brand new projects.

Settings: vsync off. Capped fps to 60.
The same thing happens even at 160 damn frames per second. This has to be the most annoying thing I ve seen in an engine by far!
Are the devs going to fix this? Because this thing results in making unity seem very unprofessional and glitchy.
My multiplayer fps is severely suffering from this issue.
Yes, I am quite mad… because of this tiny issue ruining a whole engine.

1 Like

Wow… Take a chill pill dude.

Now, if this was a common problem with the engine, this forum would be full of people complaining about it. But, as there aren’t hundreds of complaints, it leads me to believe there is something that you are doing or something amiss on your system. So before you cry to the Unity engineers saying that the engine is broken, when it is most obviously not (there are issues though…)

Did you write the mouse look script? Would it be possible to see the code?

What is in your scene? Does it occur in an empty scene with no realtime GI? with only static geom? moving geom? in both render paths? with baked lights? realtime lights?

Have you tried it using the keys to rotate the camera instead of the mouse?

Have you disabled/enabled anti aliasing? Or if in deferred, tried adding a anti aliasing screen effect?

how about your system? Windows? Max? GPU? Drivers?

1 Like

Man, I get 160 frames per second ! Its not my system that is slow. It happens on a new project too…as I said above. I ve tried all rendering modes, and the result is always the same.
It works perfectly in the poor blender game engine. .hah…
I have used all mouse look scripts I ve seen on the Internet. .built in, optimized looks, etc, all behave the same.
I got no active AA running.
I ve seen this stuff happening to many other users, and it might be engine fault, because of how it handles mouse input.
The engine might be broken when it comes to mouse sampling / polling rate. . It might have a limitation.

It is either some frame smoothing going on or the mouse input is broken.

1 Like

Can you please describe the problem a bit more clearly? I don’t quite understand. Is the image blurry like motion blur is applied to the camera? Or are you experiencing input lag like from shitty monitors? Is there a way you could upload us an empty project with only your mouselook implementation where we could reproduce and experience the issue?

While the tone of your messages isn’t perfect to maximize the amount of help you get on a forum I’m gonna give you the benefit of the doubt here because I know that not all people are able to see micro delays or even differences between 48fps and 24fps movies in a cinema. I think there is a chance you are on to something that simply isn’t recognizable for a majority of people.

Well, when I am moving my mouse , looking around, quickly aiming, the accuracy is not crisp. The rendering/ camera is behind my mouse movement. I dont know how else to describe it. Its like I would have some sort of smoothing applied to my mouse look or something. The input is lagging, and its only happening in unity, games and other game engines work fine.

1 Like

Alright, I think I know what you mean. So how about a sample project to reproduce this? I’d check it out, see if I can reproduce your result and play around with settings to see if I can fix it. Can’t promise anything, but I would try. If there actually is something to fix for the devs (which I still doubt), then they will need a sample project to reproduce the issue too.

There might be something in the Input settings for the mouse horizontal and vertical sensitivity or something? I think there are a few settings you could play with there?

Ok, I found out what is going on.
By simply putting the mouseLook script running into a fixed update with a timestep of 0.015 , my mouse movements and rendering is super crisp. This automatically means that unity looks for input changes based on framerate, while it should not. So, for super crips mouse movements,I gotta run the script on a higher frequency than update,which sucks! Now my physics have to run at a higher frequency too…Is there any other way to create another fixed update?

1 Like

I really dont get what your saying, ive never had to do that when using the default mouse look? I really think your likely using some component in a wrong way or have coded your physics badly. Post your physics code on here so we can see it, and tell us exactly what objects you have and what is attached to them

if (axes == RotationAxes.MouseXAndY)
        {
            float rotationX = transform.localEulerAngles.y + Input.GetAxisRaw("Mouse X") * sensitivityX;
           
            rotationY += Input.GetAxisRaw("Mouse Y") * sensitivityY;
            rotationY = Mathf.Clamp (rotationY, minimumY, maximumY);
           
            transform.localEulerAngles = new Vector3(-rotationY, rotationX, 0);
        }
        else if (axes == RotationAxes.MouseX)
        {
            transform.Rotate(0, Input.GetAxisRaw("Mouse X") * sensitivityX, 0);
        }
        else
        {
            rotationY += Input.GetAxisRaw("Mouse Y") * sensitivityY;
            rotationY = Mathf.Clamp (rotationY, minimumY, maximumY);
           
            transform.localEulerAngles = new Vector3(-rotationY, transform.localEulerAngles.y, 0);
        }
    }

Post all of it, what update is it in? whats the awake/start method look like? what variables are being declared at the top? what other methods are in the script? what is the script attached to, and what components does that object have? what else is in the scene? we need as much info as possible if we are to be able to help you.

1 Like

Normally is called in Update, there are no other important values declared. As I said before, the input lag happens even on new project with just a plane and a cube. Its more like a input problem, than graphics or scripting. Running the mouselook into fixed update set to a high frequency results in crisp mouselook, which makes it clear is something about the input going on.

What’s so hard then to provide that stuff to people to try it out and possibly find a better solution or send a bug report? You really are not helping your own cause at all. Great if you found a way around it by doing stuff in fixed update. Make a sample project where people can compare both methods and upload it.

1 Like

Im afraid people wont even notice. And I can t just upload my entire game to show you guys what is wrong. You can try yourself , set the fixed timestep to 0.01 and run the mouse look into fixed update, then run it in update, you could notice the difference! The look around will be much smoother and responsive!

So which one is it?

1 Like

Raw mouse is actually a horror story. All games filter it to a degree, even drivers filter it. You never get the actual hardware tracking if that’s what you think. As for polling faster, this isn’t the solution. It will still just be a lot more samples with jitter.

When you move your mouse around the desktop, it’s filtered. It doesn’t look it or feel it but it is. Some game engines get the mouse data in different ways but ultimately, you want to pass it through a filter for smooth movement, and multiply it into a sensible range for your game, ie sensitivity slider. Unity’s flaw I guess is daring to give you unfiltered movement and expecting you to be a developer.

2 things you can do: 1. buy an input asset that does mouse polling from dll outside of Unity’s main loop. This will give you faster updates than your framerate but it still won’t fix jitter. And 2. fix jitter. Add a curve or smooth it. You can tighten the smoothing to the point where it isn’t adding any lag, ie just 2 frames are enough with cutoff for different signs - ie go left smoothed, but go right and it resets from that point - keeps it very sharp.

It’s simply you’re expecting a filtered result and not understanding why it’s like this.

4 Likes

All that because unity devs are too lazy to implement a decent solution for this or what ? I mean come on! We got unity 5 , realtime gi, pbr shaders all those goodies, but the mouse performs so badly…too bad man, too bad…

However, why is it performing better when I put the mouse script into a high frequency fixed time step update?

1 Like

Because your main Update is infested with terrible code. Oh yeah, all this whining and bitching at unity makes me think you’re 10 years old. Might want to fix that first.

4 Likes