#jittery when moving screenspace
1 messages · Page 1 of 1 (latest)
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
I'm off to sleep now, but I'll have a look in the morning.
appreciate all the help man ❤️
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
BlueStacks?
its a phone emulator you can use on computer
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.
I'd be careful to make sure that it's not an issue with the emulator..
I've tested it on my phone quite a bit also
big issue there
Ok. Upload the apk somewhere then. I'll have a look on my phone when I have time.
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
It seems like I need your permission to access the Google drive file...
oh sorry, changed the settings now, didn't save the anyone with link can open piece :/
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
All good man, appreciate the help!
Wasnt any difference transform in update
Then it's probably how it will look like at 30 fps and there's not much you can do.
Feels weird that when character animates and not moving in screenspace its smooth
¯_(ツ)_/¯
I think it's more when the camera moves
Ya
The reason is probably how our brains interpret the picture. When things move relative to each other, the difference between frames is more apparent.
That makes senss