Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 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 THE-PCProgramer · Nov 12, 2019 at 06:59 PM · rigidbodyaddforcerigidbody.addforcechange variable

When Movement speed Change once it never change again

So I'am making A game and iam using a ball with a Rigedbody3D on it on the fixed update of the ball/player there is this code

using System.Collections; using System.Collections.Generic; using UnityEngine;

public class PlayerMove : MonoBehaviour {

 public float MovementSpeed;
 public float MovementSpeedForOthers;
 [SerializeField]
 private float SidesMovmentSpeed = -40f;


 public Vector3 DirForWord;
 public Vector3 DirLeft;
 public Vector3 DirRight;
 public Vector3 DirDown;



 void FixedUpdate()
 {
     DirForWord = new Vector3(0, 0, MovementSpeed );
     DirLeft = new Vector3(SidesMovmentSpeed, 0, 0);
     DirRight = new Vector3(-SidesMovmentSpeed, 0, 0);

     //        this.GetComponent<Rigidbody>().velocity = DirForWord * Time.deltaTime;
     this.GetComponent<Rigidbody>().AddForce(DirForWord * Time.deltaTime, ForceMode.Impulse);

     if (Input.GetKey(KeyCode.A))
     {
         this.GetComponent<Rigidbody>().AddForce(DirRight * Time.deltaTime, ForceMode.Impulse);
     }
     if (Input.GetKey(KeyCode.D))
     {
         this.GetComponent<Rigidbody>().AddForce(DirLeft * Time.deltaTime, ForceMode.Impulse);
     }
 }

}

and Iam using a another 2 scripts called Player_booster And Player_Slower The Point is the Player_booster change the MovmentSpeed in the Playermove script to * 2 And the Player_Slower Do movmentSpeed/2 and both of these scripts going to change the speed back to normal after 1 sec but the proplme of this when one of the Slower or Booster scripts worked on the player let say the player ran the slow script his speed gonna be devided by 2 and get back to normal after 1 sec but if he ran the boost script after that his speed get multiplied by 2 normily but he doesnt go faster at all for some reason I tried all the forces mode but none worked I think this is a unity glitch or something please if you have an idea of the fix comment becuase I dont think Iam able to fix this by my own and sorry for bad spelling Cant help it.

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by williamclarks · Nov 02, 2020 at 03:05 PM

My friends and I decided on a similar case. Then the problem was with the web hosting provider. Maybe now you need to contact technical support?

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 JohnKlein94 · May 03 at 02:30 PM 0
Share

It's strange that it didn't work, and I also don't understand why.

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

158 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 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 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 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 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 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 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

Force is being added to wrong RigidBody 1 Answer

How to make rigidbodies on each side of a cube fall towards the cube? [multiple gravity / addForce] 0 Answers

Rigidbody.velocity seems to be breaking jumping physics 0 Answers

Freeze Position + collision? 0 Answers

Physics in 2D mode not working? 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