Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 SUPPEAR · Feb 06, 2015 at 07:17 AM · androidobjects

Force Constant Velocity On Game Object?

Hello, I am having trouble with my game. My game is an avoid the objects game and the objects are constantly falling down. But due to Physics they all gain speed falling down making my game near impossible. I am trying to figure out how to make it so that the objects all have constant velocity and then freeze when they hit the ground/another object. My game is 2D and is for the Android. The objects are squares. All help is appreciated.

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 alok-kr-029 · Feb 06, 2015 at 07:22 AM 0
Share

Have you changed the mass and the gravity scale of the game objects make it same for all the falling game objects

avatar image Jiro-Ng · Feb 06, 2015 at 07:33 AM 1
Share

If I ware you, I wont use the physic engine to drop the object. I will add all falling object to a list and then update the position of all object in the list every frame. this is easier to control for me.

avatar image SUPPEAR · Feb 06, 2015 at 07:36 AM 0
Share

I have done that, although since some objects spawn randomly high up they gain speed co$$anonymous$$g down.

avatar image Jiro-Ng · Feb 06, 2015 at 07:40 AM 0
Share

Do you untick the "use gravity" check in every falling object?

4 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by JustinC · Feb 06, 2015 at 07:27 AM

I am not to familiar with 2d games, but you can turn the gravity off on the rigidBody, and use rigidbody.AddForce(-Vector2.up * speed) to make it "fall" and use a OnTriggerEnter funtion to stop the addforce, or a raycast if you want it to stop at a certain range above an object.

Comment
Add comment · Show 1 · 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 SUPPEAR · Feb 06, 2015 at 07:36 AM 0
Share

I'll look into it.

avatar image
0

Answer by AndresBarrera · Feb 06, 2015 at 08:05 AM

If you are using rigidbodies, turn on the 'isKinematic' property, and turn off the gravity for each one of them. Then move them yourself.

 float speed = xxxx;//the value you want
 Vector3 direction = xxxxxx;//The direction you want to move. Normalized
 
 void Update
 {
    this.transform.position += direction * speed * Time.deltaTime;
 }


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
avatar image
0

Answer by SUPPEAR · Feb 06, 2015 at 08:26 PM

I don't think you completely realize what I want to happen, I have updated the positions manually but they all go down to a certain point. I want the objects to completely stop when it hits the floor or is stacked on top of another object.

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
avatar image
0

Answer by manihatelax3 · Nov 15, 2021 at 06:51 AM

Set the velocity of the object to zero when collided

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

24 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 avatar image avatar image avatar image avatar image

Related Questions

Make object move randomly 2D 2 Answers

Making Object Clickable(Need Guidance ASAP) 2 Answers

Destroy Object On Touch? 2D 1 Answer

Destroy Object On Touch? 4 Answers

Cannot touch cloned prefabs 0 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