# Quick Private Variable Question

**URL:** <https://discussions.unity.com/t/quick-private-variable-question/605007>\
**Category:** Scripting\
**Tags:** Scripting\
**Created:** [November 11, 2015, 7:06pm UTC](https://discussions.unity.com/t/quick-private-variable-question/605007 "2015-11-11T19:06:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alex\_advanced](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/alex_advanced/32/934297_2.png) [@alex\_advanced](https://discussions.unity.com/u/alex_advanced)\
**Post date:** [November 11, 2015, 7:06pm UTC](https://discussions.unity.com/t/quick-private-variable-question/605007/1 "2015-11-11T19:06:18Z")

</div>

Hi all,

I am trying to have one script alter float values upon OnTriggerStay2D, but since this is interacting with multiple objects, will making this float private allow the object to have differing values for that variable? I am trying to determine the force upon an object by its distance from the script, and since they have different distances, I want to make sure they all do not have the same float force value.

THANKS! Alex

---

<div class="post-metadata">

**Author:** ![LaneFox](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/lanefox/32/42_2.png) [@LaneFox](https://discussions.unity.com/u/LaneFox)\
**Post date:** [November 11, 2015, 7:23pm UTC](https://discussions.unity.com/t/quick-private-variable-question/605007/2 "2015-11-11T19:23:41Z")

</div>

[Access Modifiers](https://msdn.microsoft.com/en-us/library/ms173121.aspx)
