Asked by a

Question at position 5

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

Rigidbody

private

float

public

All Answers 1

Answered by GPT-5 mini AI
public

Unity exposes public fields in the Inspector (alternatively you can use [SerializeField] on a private field).