Search code examples
3dsmaxmaxscript

For loop not running as intended


Why is this giving me the value of `front_post_count = 3.0 instead of 4.0 ?

canopy_length=10000
front_post_count=ceil(canopy_length/3500)+1
for i=1 to front_post_count do
(
    print(front_post_count)
)

Solution

  • I don't know what maxscript is, but 10000/3500 might evaluate to an integer (2 in this case) and not to a float. Maybe try 10000/3500.0 instead.