Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by muntahu · Dec 27, 2010 at 03:10 AM · networkinginstantiatebulletprojectile

Projectile over network problem

var instantiatedProjectile : Rigidbody = Network.Instantiate(projectile, transform.position, transform.rotation, 0);

     instantiatedProjectile.velocity = transform.TransformDirection(Vector3(0, 0, speed));

     Physics.IgnoreCollision(instantiatedProjectile.collider, transform.root.collider);

I want to instantiate a projectile over the network. It works, but only in one side. For example, client does shooting, it works normally in client. But in server side, the bullets are moving very very slow and the directions are weird.

So, the question is how to synchronize it?

Anyone can help? Thanks :)

Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Justin Warner · Dec 27, 2010 at 04:09 AM 0
Share

Use SmartFox server, it'd save you a lot of trouble. Personal opinion though, can't help directly.

avatar image muntahu · Dec 27, 2010 at 04:18 AM 0
Share

I think the problem is in the script, not technology. The game uses LAN connection by the way. But thanks for responding. Anyone can help?

avatar image jorgon · Apr 24, 2012 at 10:27 AM 0
Share

I have the same problem. $$anonymous$$untahu, please, did you solved this problem?.

Thank you.

I've got a jitered trajectory for all my instanced projectiles over my network. I don't know what to do...Any tutorial where this is solved for a $$anonymous$$aster-Server connection?.

Thank you in advance.

avatar image Bunny83 · Apr 24, 2012 at 10:47 AM 0
Share

@jorgon: The question is one and a half years old. The last time the op was on is also a year ago. I don't think hs would answer your "comment".

Anyway, like @Techsuport-1 said the problem is propably that those additional actions (setting a movement speed and setting ignore collision) are only done on the pc of the projectiles owner (the guy that shoots it).

You don't need to use RPCs for such an task. As long as they doesn't need further dynamic information the projectile should have a script attached that does those self-initializations.

So on a script on the projectile prefab do some thing like that:

 var speed = 5.5
 
 function Start()
 {
     rigidbody.velocity = transform.TransformDirection(Vector3(0, 0, speed));
     Physics.IgnoreCollision(collider, transform.root.collider);
 }

Of course the projectile needs it's own speed variable. If you want different speeds you have to use RPCs. Alwasy ask yourself what information does the other side have about an object. Everything that's missing but needed has to be send over in some way.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Techsuport 1 · Mar 15, 2011 at 02:51 AM

u will have to do the velocity and collision in an RPC call i think, cause that will only set that stuff localy.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

Problem making a Network projectile Instantiate. 0 Answers

Multiplayer projectiles 0 Answers

Proper way to instantiate projectile in PUN 1 Answer

How do I keep track of projectile owners in a networked game? 1 Answer

Gun Projectile Shooting In Wrong Direction (Javascript) 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges