Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
1
Question by Andrew Cherkashin · Apr 18, 2010 at 02:19 AM · movementnetworkingsmooth

Smooth transform

I'm writing MMORPG game. Every seconds clients send their coordinates to my server and then server pushes it to another clients. So my problem is - how i can create smooth transform? Here is my client code:

transform.Translate(Vector3.forward * Time.deltaTime, transform.Find("Compas"));

It's totally okay for me. but when i tried to use that code for another players it doesn't work for me. Here is my code for another players:

anotherplayer = GameObject.Find(updatexml.players[i].username);                     
anotherplayer.transform.Find(anotherplayer.name + "_compas").LookAt(new Vector3(updatexml.players[i].x_coordinate, updatexml.players[i].y_coordinate, updatexml.players[i].z_coordinate));
anotherplayer.transform.Translate(Vector3.forward * Time,   anotherplayer.transform.Find(anotherplayer.name + "_compas"));

p.s. that job is running as coroutine.

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by StephanK · Apr 18, 2010 at 09:32 AM

FIrst of all using Find() is supposed to be really slow, so using it in an update method (or coroutine) is not recommended. You should probably think about updating the positions of the client's more than once per second. In any case you'd have to use some kind of movement prediction for the frames between those updates. One way to do this is to determine the last known velocity of the player, move it accordingly and correct errors after the next position update.

Comment
Add comment · Show 2 · 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
avatar image Andrew Cherkashin · Apr 18, 2010 at 10:36 PM 0
Share

what should i use ins$$anonymous$$d of Find() ? Create hashtable? Updating more that 1 time per second is a bad idea.

k

ind of movement prediction for the frames between those updates.

That's what i want, but i have no idea how to do it...
avatar image StephanK · Apr 19, 2010 at 12:47 PM 0
Share

As I said, simplest way of doing it would be to store the last known velocity of each object/player on the server and as long as you don't have a new position move the player with that velocity.

avatar image
0

Answer by Xenland · May 14, 2011 at 04:34 AM

You could use the Lerp command or MoveToward commands to answer your question

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

No one has followed this question yet.

Related Questions

Unity Network, smooth interaction between client and server player objects 0 Answers

Smooth Movement with RPC's 1 Answer

Unity networking tutorial? 6 Answers

How to smoothen out ball movement using Photon 1 Answer

Unity 2D - Smooth movement over tiles?? 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