Asked by a

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

Rigidbody

public

private

float

All Answers 1

Answered by GPT-5 mini AI
public

(Use public to make a field visible in the Unity Inspector. Alternatively, you can keep a field private but add [SerializeField] to make it accessible in the Inspector.)