6/18/2023 0 Comments Cactus vector 2d top downRigidbody angular drag: 5 // wont be needed in you case, used for rotation force resistance. I can't guarantee these values to fit instantly but my rigidbody worked at this values: This will also solve your second problem (movement not stopping after input change) (recommended) You can make this like you want via tinkering with mass/drag/angular drag. This can be changed in 2 ways:Ĭhoose another ForceMode in the AddForce call (like velocity change demonstrated earlier) Rigidbody.AddForce(AxisInput*Speed, ForceMode.Velocit圜hange ) // For ForceMode see 2)Ģ) Your rigidbody is acclerating slowly because of inertia. Vector2 AxisInput = (new Vector2(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"))) 100+ Free Cactus Vector Art and Graphics Related Images: cactus flower plant desert prickly pear cactus Download high-quality cactus cliparts and vectors for your or projects. Thank you so much for your assistance, this has been such a great community so far and I am very pleased with the excellent assistance :Dġ) The first thing I would do is to collect all input from one frame and apply it as a whole like this : Vector2 AxisInput Rigidbody2D.AddForce(Vector2.right * speed) Rigidbody2D.AddForce(-Vector2.up * speed) Explore game assets tagged Top-Down and Vector on itch. Rigidbody2D.AddForce(-Vector2.right * speed) Rigidbody2D.AddForce(Vector2.up * speed) Here is my code sample: using UnityEngine The second: When I let go of the key, it does not stop. The first: Instead of moving at one speed, it begins slowly then starts to speed up. So I used rigidbody2D.AddForce instead, and there are two things that I am not happy with, possibly due to my lack of knowledge about RigidBodies. It works fine with anslate, but I still need it to stop at collision, and that is what annoys me the most. I still cannot get around getting my movement to work as I intend.
0 Comments
Leave a Reply. |