The Photon Forum
is Closed Permanently.

After many dedicated years of service, we have made the decision to retire our Forum and switch to read-only: we´ve saved the best to last! Your search result can be found below. Plus, we offer support via these channels:

Try Our
Documentation

Please check if you can find an answer in our extensive documentation on PUN.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Read More on
Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

How to implement a Networking Line Renderer in my Script?

EinfachFinn
2022-05-14 04:19:47

Hey Im having some trouble with my script. I want the Line Renderer to be synced but I dont know how. Even after some research I dont know how to do it. May someone please write these RPC function into my script?

using UnityEngine;

using Photon.Pun;

public class GrapplingGun : MonoBehaviour {

Comments

Tobias
2022-05-18 12:04:51

To render a line, you have to provide an array of points. So you could turn your drawing movement into a series of vectors and send that. Avoid sending every point on it's own and instead send a few of them every 0.x seconds instead.

Aside from using RPCs you could also setup a networked object with a PhotonView and have it call OnPhotonSerializeView() on a script of your own. I there, write / read the array and apply it to a line renderer.

Back to top