Input from old to new

Keep getting an error invalidOperationException: You are trying to read Input using the UnityEngine.Input class, but you have switched active Input handling to Input System package in Player Settings.

Have written code exactly like the instructor has in video.

Vector2 mousePos = Input.mousePosition;
Vector3 playerToScreenPoint = Camera.main.WorldToScreenPoint(mousePos);

1 Like

Your project is set to use the new input system, but you are using old input code. You likely want to set the project to use both input systems. You can change the setting in Edit -> Project Settings... under Player

2 Likes

Thanks, didn’t see that option tucked away under different section.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms