Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

  • 0
Xendz

Photon RPC Prefab Projectile

Question

Does anyone have or can show me an example of using RPC in Photon to sync the projectiles. (rockets or cannon ball).

Thanks have looked but nothing seems like good enough example

Share this post


Link to post
Share on other sites

57 answers to this question

Recommended Posts


  • 0

Please login or register to see this link. is the game im working on, even in the video you can see the cannon firing the "pulse" is not syncing with the other.

Share this post


Link to post
Share on other sites
  • 0
Please login or register to see this quote.

 

in photon rpcs eat bandwith as hell, thats why theres onserialize

Share this post


Link to post
Share on other sites
  • 0
Please login or register to see this quote.

 

no they dont, serialize eats a lot more, rpc shouldn't be sent nowhere near every frame or similar

Share this post


Link to post
Share on other sites
  • 0

Any example of what im asking for guys that you know of? ive done alot of googling and can't really find exactly what im looking for.

Share this post


Link to post
Share on other sites
  • 0

Just send an RPC with a Vector3 (direction + magnitude) as parameter. Instantiate and calculate the projectile physics client-side. This is the most bandwidth efficient method, but not completely reliable.

Share this post


Link to post
Share on other sites
  • 0

Please login or register to see this code.

Can anyone help me?

 

Current error :. Assets/shoot.cs(24,36): error CS0120: An object reference is required to access non-static member `PhotonView.RPC(string, PhotonPlayer, params object[])'

 

 

Can't seem to get it down

Share this post


Link to post
Share on other sites
  • 0

@themars2011 Default sendrate for RPC's is 20, but for OnSerialize only 10. You understand what it means?

Share this post


Link to post
Share on other sites
  • 0
Please login or register to see this quote.

 

if you send an rpc in update and have 60 fps wouldnt that mean an update rate of 60 ?

Share this post


Link to post
Share on other sites
  • 0

No, as far as I understood theres no limit and you have to limit it yourself, e.g. with a coroutine

Share this post


Link to post
Share on other sites
  • 0

The same with Photon.

PhotonNetwork.sendRateOnSerialize = 30;
PhotonNetwork.sendRate = 60;
      

Share this post


Link to post
Share on other sites
  • 0

You watched this video?

Please login or register to see this link.

 

You dont see mistakes in your script?

Share this post


Link to post
Share on other sites
  • 0

Yeah I did I based it off of that video. haha ill watch it again thanks.

 

Well, they are using networkview I would like to use photon.

Edited by Xendz

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...