#jittery when moving screenspace

1 messages · Page 1 of 1 (latest)

brisk owl
#

I have a tilemap, a cinemachine camera, a joystick to test mobile movement(which is where you can see issue easily) and a player

#
using UnityEngine;

public class PlayerTest : MonoBehaviour
{
    [SerializeField] Joystick joystick;
    float movement = 0;
    bool down = false;
    Rigidbody2D _rb;
    private void Start()
    {
        _rb = GetComponent<Rigidbody2D>();
    }
    private void Update()
    {

        if (joystick.Horizontal >= 0.3f)
        {
            movement = 1f;
            //Debug.Log("Right");

        }
        else if (joystick.Horizontal <= -0.3f)
        {
            movement = -1f;
            //Debug.Log("Left");

        }
        else
        {
            movement = 0f;
        }
        // if Joystick down, fall through platforms
        if (joystick.Vertical <= -0.4f)
        {
            down = true;
            //Debug.Log("down true");

        }
        else
        {
            down = false;
        }
        //movement = Input.GetAxisRaw("Horizontal");
    }
    private void FixedUpdate()
    {
        var _currentVelocity = new Vector2(movement * 7, _rb.velocity.y);
        _rb.velocity = _currentVelocity;

    }
}
#

entire player script

hearty gyro
#

I'm off to sleep now, but I'll have a look in the morning.

brisk owl
hearty gyro
#

Did you share the video of what that jitter look like?

#

That would be most helpful.

brisk owl
#

3-6s in

#

hard to see in video unless you have vid quality set high

#

moving from the left->right

#

I can drop anyone an apk that shows it off also, very obvious in bluestacks or on mobile

hearty gyro
#

BlueStacks?

brisk owl
hearty gyro
#

Yeah, maybe share the apk via Google docs or something, because I really can't spot any jitter on the video. Maybe only for the trees in the background.

hearty gyro
brisk owl
#

big issue there

hearty gyro
#

Ok. Upload the apk somewhere then. I'll have a look on my phone when I have time.

brisk owl
#

top link is with everything still on scene

#

2nd link is same issue but with basically empty and remade everything

#

cinemachine settings

#

(tried putting it at late or fixedupdate for update method, same issue)

#

I remade the player function to only work for transform.position as well, same issue

#

I have no idea anymore

#

except maybe its just like this cause low fps

hearty gyro
#

It seems like I need your permission to access the Google drive file...

brisk owl
hearty gyro
#

I was a bit busy, so just got to test your apks. Honestly, I'm not sure if it can be any better with 30fps.🤔
Try that: instead of moving your character with velocity, move it via transform in update and see if there's any difference in terms of the jitter.@brisk owl

brisk owl
#

Wasnt any difference transform in update

hearty gyro
brisk owl
#

¯_(ツ)_/¯

hearty gyro
#

I think it's more when the camera moves

brisk owl
#

Ya

hearty gyro
#

The reason is probably how our brains interpret the picture. When things move relative to each other, the difference between frames is more apparent.

brisk owl
#

That makes senss