Giter VIP home page Giter VIP logo

Comments (4)

Briancoughlin avatar Briancoughlin commented on May 18, 2024 1

THis is now in process and will be updated. Thanks for your contribution

from com.unity.multiplayer.docs.

JohnMiki47 avatar JohnMiki47 commented on May 18, 2024

Maybe the solution is as simple as changing this code section:
if (NetworkManager.Singleton.IsServer) { var randomPosition = GetRandomPositionOnPlane(); transform.position = randomPosition; Position.Value = randomPosition; } else { SubmitPositionRequestServerRpc(); }
to this?
if (NetworkManager.Singleton.IsServer) { var randomPosition = GetRandomPositionOnPlane(); transform.position = randomPosition; Position.Value = randomPosition; } else if (IsLocalPlayer) { SubmitPositionRequestServerRpc(); }

Or am I not understanding it correctly?

Thanks for the reply.

from com.unity.multiplayer.docs.

Briancoughlin avatar Briancoughlin commented on May 18, 2024

@Cosmin-B do we need to add some clarification to the guide here or is their an issue with the code as written?

from com.unity.multiplayer.docs.

Alphamplyer avatar Alphamplyer commented on May 18, 2024

I had the same warning ("Only the owner can invoke a ServerRpc that requires ownership!").
The solution is simple. This warning is called when I started the client side. Just add this line to the HelloWorldPlayer.cs script in the NetworkStart Method :

public override void NetworkStart()
{
	if (!IsOwner) return;
	Move();
}

When we start the client the NetworkStart Method is called on both instance of the player script (the host one and the client one).

from com.unity.multiplayer.docs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.