Home› Troubleshooting
Discussion
Back to discussions page
dannyhef
Unconfirmed Posts: 7 Apprentice
UR script multiple returns |
32 views
|
Answered | |
/ Most recent by matthewd92 |
8 comments |

def describeCircle(radius):
local circumference = 6.28*radius
local area = 3.14*radius*radius
return [circumference,area]
This would not work as center is a point, either list or pose, and radius is a number so types are mismatched.
def describeCircle(a,b,c):
local center = findCenter(a,b,c)
local radius = findRadius(a,b,c)
return [center,radius]
end
[[point],[value],[...]]
I tried it the way you did.
def describeCircle(radius):
local area = 3.14*radius*radius
return [circumference,area]
and then I tried to call/store the new variables and this didn't work.
[circumference, area] = describeCircle(radius)
local area = values[1]
local volume = getVolumeFromAreaAndHeight(values[1], height)