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
0
Question by eshanmind · May 05, 2016 at 12:15 PM · noobstuckrigidbody.addforce

Player gets stuck after AddForce in Air

In my 3d game, I have a sort of bounce pad that when jumped on, sends the player up with a certain force, the problem is, when it adds the force, i cant come back down, can someone please help me with this?? If it helps, this is the code for the Bounce Pad

 using UnityEngine;
 using System.Collections;
 
 public class BouncePad : MonoBehaviour {
 
     public float force;
     // Use this for initialization
     void Start () {
 
     }
     
     void OnTriggerEnter(Collider Player){
 
             Player.GetComponent<Rigidbody> ().AddForce (Vector3.up * force);
 
             Debug.Log ("It WORKS IT WORKS");
         
 }
 }




The Player has IsKinematic disabled and Gravity enabled. There are no compiler errors

Thanks in advance!!

Comment
Add comment · Show 2
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 eshanmind · May 08, 2016 at 01:29 PM 0
Share

It does slow down, And thanks! It worked!

avatar image eshanmind · May 11, 2016 at 02:22 PM 0
Share

Oops, no it doesn't, it took me down a little after a jump, but thats it.

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Glurth · May 05, 2016 at 03:32 PM

Does the object continue to move up at the same rate, or does it start to slow down at ALL? If slowing down, then gravity IS working, and you probably just need to adjust it's strength, or reduce the force you apply. If you are not sure, increase gravity as a test. ( docs on changing that... http://docs.unity3d.com/Manual/class-PhysicsManager.html)

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 V-O-D-Games · May 09, 2016 at 09:54 AM

Hi! The easiest and simple way to this would be to actually add force to the player and basically create your own gravity and this sounds crazy but can be simple so on your player in: void Update (). Add a if statement checking for the player being grounded. I'll later add a C# code in this answer for you

If you however want to try it on your own basically what you do is: have a variable for your gravity (I prefer using a float variable). In void update use and if statement like this: "if (gameObject.IsGrounded = false" you must then have a vector 3 to add downward force so use: rigidbody.AddForce (0, (-) gravity varible, 0);

That is how its done I think but I'll test it later for you

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 V-O-D-Games · May 09, 2016 at 05:19 PM

Hi! The easiest and simple way to this would be to actually add force to the player and basically create your own gravity and this sounds crazy but can be simple so on your player in: void Update (). Add a if statement checking for the player being grounded. I'll later add a C# code in this answer for you

If you however want to try it on your own basically what you do is: have a variable for your gravity (I prefer using a float variable). In void update use and if statement like this: "if (gameObject.IsGrounded = false" you must then have a vector 3 to add downward force so use: rigidbody.AddForce (0, (-) gravity varible, 0);

That is how its done I think but I'll test it later for you

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 V-O-D-Games · May 09, 2016 at 06:24 PM 0
Share

Lol sorry bad internet connection made me make 2 answers

avatar image eshanmind · May 11, 2016 at 02:23 PM 0
Share

What do you mean by "gravity Variable"?? Other than that, i'll definitely try it, no need to bother yourself to test anything, just go help other people :)

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity random generator kills programm 2 Answers

Most efficient way to get scores 1 Answer

Skybox Only Rendering One Side? 2 Answers

C# initializing array of structs error 1 Answer

unity2d how to fill color outside of a shape 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