Hi, I’m trying to achieve something very simple using ECS Transforms. I believe something is fundamentally broken with Unity implementation of the Transforms
1 - Player constantly accelerates on Player Input and Translated by its Speed
2 - Another Object wants to be always at a fixed Offset to the Player
3 - Camera Follows the Player
The Result:
- Follow object constantly jitters
Why is this problematic:
- There’s ZERO jitter problem if I use Graphics.DrawMesh, in the same system, the same line, instead of setting object position!
Here’s the Result with Transforms:

Here’s the Result with Graphics.DrawMesh:

I’ve attached the very basic scripts to make this behavior happen
FollowAuthoring.cs (334 Bytes)
FollowCameraSystem.cs (543 Bytes)
FollowSystem.cs (791 Bytes)
FollowTag.cs (92 Bytes)
MoveAuthoring.cs (384 Bytes)
MoveSystem.cs (1.3 KB)
MoveTag.cs (90 Bytes)
Speed.cs (107 Bytes)
Bump? I couldn’t solve this problem
Hi, I have the same exact problem, have you found a solution? I mean it’s really bad for my game… Only the thing I am following jitters, the other stuff is ok which is really weird.
EDIT:
I’ve tried the Graphics.DrawMesh approach and it works without any jitter, but wtf, is there a better way?
Basically I’ve attached the ManualRenderMeshComponent (which is an empty component I created) to my player only and I’ve disabled the mesh renderer on the player, and it now renders the cube without any jitter (yeah for this sketchy test I’m rendering a cube, not the player)
using Unity.Entities;
using Unity.Transforms;
using UnityEngine;
[UpdateInGroup(typeof(SimulationSystemGroup))]
partial struct ManualRenderSystem : ISystem
{
public void OnUpdate(ref SystemState state)
{
DebugMeshes.Init();
foreach (var (render, transform) in SystemAPI.Query<ManualRenderMeshComponent, LocalTransform>())
{
var matrix = Matrix4x4.TRS(
transform.Position,
transform.Rotation,
Vector3.one * transform.Scale
);
UnityEngine.Graphics.DrawMesh(
DebugMeshes.Cube,
matrix,
DebugMeshes.Material,
0
);
}
}
}
public static class DebugMeshes
{
public static Mesh Cube;
public static Material Material;
public static void Init()
{
if (Cube != null)
return;
var temp = GameObject.CreatePrimitive(PrimitiveType.Cube);
Cube = temp.GetComponent<MeshFilter>().sharedMesh;
Object.Destroy(temp);
Material = new Material(Shader.Find("Universal Render Pipeline/Lit"));
}
}
No, I couldn’t find a solution to this at the time I was building that project.
You can use the Parent component for this if you want to just have the follower as a child to the parent player.
If you don’t want to go that route I suspect what’s happening is that the translation in the follow is sometimes being executed before or after the render update at random causing a jitter. When you use Graphics.DrawMesh you’re forcing that to happen during a render update as opposed to randomly before or after so you get a proper sync up.
I think if you were to ensure your player movement is being executed in FixedStepSimulation and use an EntityCommandBuffer when you set the follower’s transform you’ll see better results.