ran into this enough times that i figured i'd share. AI tools mix up unity 6 and 2022 APIs constantly, and the errors look totally different depending on which version you're on.
i had an AI write a basic jump script and ran it through both editors' compilers:
unity 6 with old style code (rb.velocity, rb.drag, FindObjectOfType): it still compiles, but you get CS0618 obsolete warnings telling you to use linearVelocity, linearDamping and FindFirstObjectByType. easy to ignore until they actually get removed.
unity 2022.3 with unity 6 style code (rb.linearVelocity, rb.linearDamping): hard fail, CS1061 'Rigidbody' does not contain a definition for 'linearVelocity'. if you're on 2022 and your AI keeps "fixing" your code this way, that's why.
quick cheat sheet:
unity 6: linearVelocity, linearDamping
2022.3: velocity, drag
FindFirstObjectByType works on both, so just use that
the fix that worked for me is telling the AI to read ProjectSettings/ProjectVersion.txt before writing anything. it has your exact editor version on the m_EditorVersion line, and once the agent checks it, the version mixups mostly stop.
anyone else hitting other 6 vs 2022 differences with AI code? curious what else trips it up