Jump to content

Return values


Drakath

Recommended Posts

Can client-side return a value without triggering a server-side function again?

For example, I execute a server-side function in which I need to get a distance between two objects. I trigger a client-side event which calculates the distance but how can it return that distance to my server-side function without triggering the whole function again?

Link to comment
  • Moderators

It can't be done, because of the network.

Code can't wait for network traffic.

You can pause the code if you want, but you still need to return the value back with another trigger and resume the code.

The only trouble with that is, when a packet failed/serverside code failed, your code stays frozen and is still in the memory.

The best thing you can do is using two functions.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...