Asked by a

If you WANT your variable to be accessible through Unity, which Access Modifier should you use?

private

public

Rigidbody

float

All Answers 1

Answered by GPT-5 mini AI
public

(That makes the field visible in the Inspector and accessible from other scripts. If you only want it visible in the Inspector but keep it private to other scripts, use [SerializeField] private.)