Replies: 1 comment
-
It's a bit unclear what do you mean without looking at actual code. But you can treat function call as a value that's returned from that function. So this is valid:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Basically, what the title says
I've tried to make a function that could calculate the distance between two objects by taking their X coordinates from the respective tables and subtracting them (with an if statement, so that, if the value returned negative because of the objects positions relative to the order they were subtracted with, the negative value is multiplied by -1).
Using print(function(object.a,object.b)) works well and gives the return value normally.
However, how can I do math operations on that return value? Do I necessarily have to store it in a global function? Or are there ways to call local functions in the referenced function, so that I can just have the function return the local variable?
Beta Was this translation helpful? Give feedback.
All reactions