0 votes

I know that I can create a method for rpc something like this:

void Rifle::_register_methods()
{
    register_method("_shoot", &Rifle::_shoot, GODOT_METHOD_RPC_MODE_SYNC);
}

And call it: rpc("name")

–°an i create a variable that i can modify remotely?

in Engine by (54 points)

1 Answer

0 votes
Best answer
register_property<PlayerControl, Vector2>("puppet_position", &PlayerControl::puppet_position, Vector2(0, 0), GODOT_METHOD_RPC_MODE_SLAVE);
by (54 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.