Is the Variable Name "roamChangeDirFloat" a little odd?

Small point but maybe

In the Section Cleanup Video at 3:26 shouldn’t the variable be called something like “_roamingFloatTime” or “roamingTime” instead of “roamChangeDirFloat” as the variable hasn’t got anything to do with direction?

    [SerializeField] float _roamingFloatTime = 2f;
2 Likes

To be honest i often find some variable or method names a little odd and i guess its written so you and your team can understand it.
As long as you are consistent with your naming then everything is fine and as long as you or your team can come back to the code weeks later and still know what it does then it doesnt really matter.

I’m still working my way through the content so have not got to this lecture so i cant really comment on the naming of this one specifically.

It sounds like it was a choice of shortening it from roamTimeTillChangeDirFloat which is ridonculous for a variable name and it does seem a little ambiguous renaming to that

1 Like

Just adding to this as i have reached the lecture now.
It does seem a little odd naming convention to include thats its a float a better naming i think would be timeToRoamDirChange as it is the time between when the coroutine is called again and changes to another direction from the GetRoamingPosition method relative to its current position.

2 Likes

Privacy & Terms