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 siddharth3322 · Jan 31, 2015 at 02:47 PM · movementunity 2dtrackjerky

Jittery track movement

At present, I am working on 2d racing game. So that I have to move track as per game requirement. For that I have written following code.

 public float speed;
 
 void FixedUpdate ()
 {
     rigidbody2D.MovePosition (transform.position + (Vector3.up * speed * Time.deltaTime * -1f));
 }

Using above code, track continuously move but with complete jerk. I can't able to understand where I have written wrong code. Please give some suggestion in this.

At present only car left/right movement and track movement code exist in game. Also I have notice that there is no FPS loss in game. I got around 70FPS in android device.

EDIT

 rigidbody2D.velocity = Vector3.up * speed * -1f;

I have tried with this code also but didn't get any success.

Comment
Add comment · Show 6
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 DESIMA · Jan 31, 2015 at 04:17 PM 0
Share

you are using a Vector3 in a 2D game? try use a Vector2 just to see if that helps. tell me what it is that you are trying to do ins$$anonymous$$d of what you are doing please.

or put same code in LastUpdate() method ins$$anonymous$$d, dont put your code on the camera.

avatar image siddharth3322 · Jan 31, 2015 at 05:22 PM 0
Share

@DESI$$anonymous$$A, you suggestions not work for me. I have change track's rigidbody Interpolate mode to Interpolate from None. This change gives some what improvement in track movement but not as smooth that I looking for.

avatar image DESIMA · Jan 31, 2015 at 05:29 PM 0
Share

I need more info on what it is that you are trying to do. post a screenshot

avatar image siddharth3322 · Jan 31, 2015 at 05:33 PM 0
Share

Following image demonstrate screenshot of my game play screen. https://www.dropbox.com/s/qwu5e1jt4imlp26/Screenshot%202015-01-31%2023.01.04.png?dl=0 If you have time then we can directly chat for problem.

avatar image DESIMA · Jan 31, 2015 at 05:37 PM 0
Share

ahh. have you tried using transform.Translate in the Update function. I dont really understand why you use rigidbody on something that has nothing to do with physics, you are just moving i.e. translating the road to follow the car. So try transform.Translate ins$$anonymous$$d and use it in Update() ins$$anonymous$$d. the reason it jiggers is because FixedUpdate is not updated as frequently as Update() is

Show more comments

0 Replies

· Add your reply
  • Sort: 

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

20 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Very jerky camera movement with rigidbody 1 Answer

character controller sinks into platform while using raycast to detect collision 0 Answers

How can you make a 2D object move based on rotation, and rotate while moving? 1 Answer

How can I keep the Ground ALIGNED with the red line in the image below 1 Answer

Help with making a map based game! 3 Answers


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